Babel
During the construction of the Tower of Babel, as you know, God confused all languages. The result was that each person knows a lot of languages. Two people can give each other information, if there is a language which they both know. Head building conveys the team on his well-known languages. Those who received these commands, can they pass on, translating into languages known to them. Determine the number of people to reach are the team leader.
Input
For convenience, we enumerate all the languages with numbers from 1 to 50. First given the number of people n (1 ≤ n ≤ 100), and then there are descriptions of what languages they know these people. For each person recorded first number m[i]
(0 ≤ m[i]
≤ 50), indicating the number of languages known i-th individual, and then lists the numbers of these very languages in ascending order (number of languages is a number from 1 to 50). It is believed that the construction manager - a person with number 1.
Output
Print the number of people to whom can "walk" to give the head of the team (including the manager).