A school selects 50 students to participate in essay and math competitions. 18 students win prizes in the essay competition, and 20 students win prizes in the math competition. 5 students win prizes in both competitions. How many students did not win prizes in either competition? Let's think step by step and output the final answer within \boxed{}.
user