Late Students
Time limit1sMemory limit1024 MB
Count the students who arrive at or after the start time and not before the teacher, since they are caught and must clean the classroom.
- Level
Easy1 of 10
- Topics
- Simulation, Implementation
- Solved
- No attempts yet
Problem
The students of class 2-4 at Sunrin High School are often late.
A student is late if they do not arrive before the set start time. However, if a student enters the classroom before the teacher, the teacher does not find out about the lateness. Students whose lateness is discovered must clean the classroom as punishment.
Given the times the teacher and students entered the classroom, find how many students will clean the classroom today.
Input
The first line contains the total number of students .
From the second line, each of the next lines contains the time a person entered the classroom, including the teacher, followed by a space and whether that person is a student. Times are in the HH:MM format. (; HH ; MM )
Line contains the set start time.
All given times are between 06:00 and 18:00.
Whether the person is a student is given as the string student or teacher.
There is always exactly one teacher.
Output
Print the number of students who will clean the classroom today.
Arriving exactly at the set start time counts as late, so a late student is caught even if they arrive at the same time as the teacher.