Explanation
The number of students taking German or Spanish is 8 + 15 = 23. Of that group of 23, 3 are taking both languages so they've been counted twice (once in the German group and once in the Spanish group). Subtracting them out leaves 23 - 3 = 20 who are taking at least one language. 35 - 20 = 15 students who are not taking either language.