Recollection
Time limit1sMemory limit1024 MB
Given N classes with student ID lists, count the students who appear in at least M of the classes.
- Level
Easy2 of 10
- Topics
- Hash map, Implementation
- Solved
- No attempts yet
Problem
Professor Noh has taught classes so far at Seoul Cyber University, in the Department of Big Data and Information Security, the Department of Artificial Intelligence, the Department of Computer Engineering, and others. One day, while looking back on the students who took his classes, he wondered how many students had taken or more of his classes.
There were too many classes and students to keep track of at a glance, so he asked you to analyze them. Given the student IDs for each class, find the number of students who meet the condition.
Input
The first line contains and .
The next lines describe the classes in order. The first line of class contains the number of students in that class. The second line contains the student IDs of class , separated by single spaces.
Each student ID consists of 8 digits and always starts with . No student appears more than once in the same class.
Output
Print the number of students who took or more classes.
Hint
Seoul Cyber University has at most students in a class, and undergraduate student IDs start with .