In a class of 30 students, 18 students play basketball, 12 students play soccer, and 5 students play both basketball and soccer. How many students play either basketball or soccer or both? Let's think step by step and output the final answer within \boxed{}.
user