In a sports fest, a school awarded 58 medals in athletics, 20 medals for indoor games and 25 medals for outdoor games. If these medals were bagged by a total of 78 students and only 5 students got medals for all the three activities, then the number of students who received medals for exactly two of the three activities is