A fruit vendor is selling apples and oranges. Each apple costs $2, and each orange costs $3. The vendor sold a total of 50 fruits and collected $120. How many apples did the vendor sell? Let's think step by step and output the final answer within \boxed{}.
user