Under construction

Still being built. Things may change

Recollection

Time limit1sMemory limit1024 MB

Summary
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 NN 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 MM 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 NN and MM. (1≤N≤100;(1 \le N \le 100; 1≤M≤N)1 \le M \le N)

The next 2×N2 \times N lines describe the NN classes in order. The first line of class ii contains the number of students KiK_i in that class. The second line contains the KiK_i student IDs of class ii, separated by single spaces. (1≤Ki≤240)(1 \le K_i \le 240)

Each student ID consists of 8 digits and always starts with 11. No student appears more than once in the same class.

Output

Print the number of students who took MM or more classes.

Hint

Seoul Cyber University has at most 240240 students in a class, and undergraduate student IDs start with 11.

Examples2

  1. Example 1

    Input
    3 2
    3
    12500001 12500002 12500003
    5
    12500001 12500003 12500005 12500007 12500009
    4
    12500001 12500004 12500007 12500010
    
    Expected output
    3
    
  2. Example 2

    Input
    3 2
    3
    12599999 12599998 12599997
    1
    12599996
    2
    12599995 12599994
    
    Expected output
    0