In a competition, a school awarded medals in different categories. 36 medals in dance, 12 medals in dramatics and 18 medals in music. If these medals went to a total of 45 persons and only 4 persons got medals in all the three categories, how many re