A train started from a station with a certain number of passengers. At the first halt, 13rd of its passengers got down and 120 passengers got in. At the second halt, half of the passengers got down and 100 persons got in. Then the train left for its destination with 240 passengers. How many passengers were there in the train when it started?