At first, Valen had some money. He spent 13 of it on a coat and 23 of the remainder on a blouse. After that, his father gave him $360. The ratio of the total amount of money he had in the end to the amount of money he had at first was 4 : 3. How much money did Valen have at first?