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 8 received an A in both courses. How many students did not receive an A in either course?