Thanks for the post whiplash2411. However, there is an easier and faster way to do this.

Math = 53

Chemistry = 88

English = 58

Total = 199This total counts x, y, z twice (students taking 2 classes) and 6 thrice (students taking 3 classes). We need to count these only once to arrive at the number of students taking exactly 2 classes.

First get rid of the double counting by subtracting the actual number of students from the total above. Deal with the triple counting in the next step.

Total = 199

No. of students =(150)

Remaining = 49Since 6 has been counted thrice, subtract 6 twice (6*2 = 12) from the remainder to count it exactly once.

Remaining = 49

Subtract 12 =(12)

Final = 37Thus, the number of students taking exactly 2 classes is 37.

Hope this helps