15, 8 and 6. all but one subtract 3 from, representing the 3 students who take all three. don't subtract the 3 from one of them, they're still in the class.
so 15, 5 and 3. 15 + 5 + 3. 23. 23 students take the 3 courses, but 7 people take none of them.