Total number of registrations that came in is 25+22+19=66, hence 36 duplicate registrations.
Say "x" number of students take all 3 subjects, "a" number take maths and eng, "b" take maths and history and "c" take history and maths.
Duplicate entries are for a+b+c+x.
so, 25-(a+b+x) + 19-(b+c+x) + 22-(a+c+x) + a+b+c+x = 30
or, 25 -a -b -x + 19 - b -c -x + 22 -a -c -x + a+b+c+x = 30
or, 25 +19 -b -x + 22 -a -c -x = 30
or 66 -(a+b+c+2x) = 30
or a+b+c+2x = 36 => duplicate registrations.... How do we get range of values for x ? We need to know number of students who took 2 subjects