Sarah is buying apples and oranges for a fruit salad. She buys 3 times as many oranges as apples. If an apple costs $0.50 and an orange costs $0.30, and she spends a total of $12, how many apples did she buy? Let's think step by step and output the final answer within \boxed{}.
user