A school awarded 30 medals in tennis, 14 in carrom and 25 in badminton. If these medals were bagged by a total of 50 students and only 5 students got medals in all the three sports, then the number of medals received by students in exactly two of the three games is