I2.3 There are less than $4 Q$ students in a class. In a mathematics test, $\frac{1}{3}$ of the students got grade $A$, $\frac{1}{7}$ of the students got grade $B$, half of the students got grade $C$, and the rest failed. Given that $R$ students failed in the mathematics test, find the value of $R$.