A survey was conducted among 50 students to find out their preferred fruit. The results were as follows: 18 students preferred apples, 22 preferred bananas, and the remaining students preferred oranges. How many students preferred oranges? Let's think step by step and output the final answer within \boxed{}.
user