There were some fiction and non fiction books in a second hand bookstore. The number of fiction bookw was 3/5 of non fiction bookw. After an equal number of fiction and non fiction books were sold,the ratio of the number of fiction books to the number of non fiction books left was 5:9. There were 240 books altogether at first. How many books were sold altogether?