A maths exam contained only two questions. Problem one was solved by 70% of the pupils. Problem 2 was solved by 60% of them. Every pupil solved at least one of the problems. Nine pupils solved both problems. How many pupils took the exam?