So at this point:
There are 1/2X people studying mathematics.
The students who study music are 1/4 X people.
The students who are learning a foreign language are 1/7 X.
The listed inequalities are x-1/2x-1/4x-1/7x.
Inequality solution: x < 56
So the number of people can't be a fraction, and according to the hidden hints in the topic, X must be a multiple of 2, 4 and 7. If the number of people is less than 6, X will have an integer solution until the number of people is equal to 3, and X is equal to =28.
There are 28 students in this class.