Of the 25 graduating students in a school, 18 attended the semi-formal dance and 17 attended the formal dance. If 16 students attended both events, how many graduating students did not attend either of the two dances?