At first, Ali had some money. He spent 20% of it on some books and 5/8 of the remainder on old. After that, his parents gave him $90. The ratio of the total amount of money he had in the end to the amount of money he had at first was 3:2. How much money did he have at first?