Everyone in a class of 35 students takes math and history. 8 students received an A in history, 15 received an A in math and 3 received an A in both courses. How many students did not receive an A in either course?
<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
Everyone in a class of 35 students takes math and history. 8 students received an A in history, 15 received an A in math and 3 received an A in both courses. How many students did not receive an A in either course?
Please reason step by step, and put your final answer within \boxed{{}}.<|im_end|>
<|im_start|>assistant

user
15
Everyone in a class of 35 students takes math and history. 8 students received an A in history, 15 received an A in math and 3 received an A in both courses. How many students did not receive an A in either course?
train