In a school, a student can opt the language subject out of English, Hindi and Sanskrit either single or in a combination.
50 students opted English, 62 Hindi and 42 Sanskrit.
If there are total of 78 students and only 12 opted for all three languages, then what is the number of students who opted for exactly two languages?