Explanation
The number of students taking German or Spanish is 5 + 11 = 16. Of that group of 16, 4 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 16 - 4 = 12 who are taking at least one language. 18 - 12 = 6 students who are not taking either language.