#000112

z-birthday-party

As you already know, today is Z's birthday. So he decided to throw a party. During the party Z realized that his friends tend to hang-out in groups. More precisely, Z thinks that he can group his friends into group, so that all the friends from one group had not set at a table with any of the friends outside the group during the party.


Z has recorded all the table configurations during the party. More precisely, when some of his friends sit on a table, Z will record that. It would always happen that some of his friends sit at a table at the same time, and leave (go to dance) at the same time


Z gave you the list of all the table configuration, and asked you to find out how many "isolated" groups of friends are there (as described above)


InputFrom the standard input read a number n (1 <= n <= 10000), the number of table configurations. From each the next n lines read a number m (1 <= m <= 100) and m strings (up to 20 characters of english alphabet, without spaces), representing the names of the friends that set on the table. All Z's friends have different names.

OutputTo the standard output, print one integer representing the number of groups (as defined in the text) of Z's friends

Input:
4
2 aleks boba
2 boba dule
3 pitt angelina jordan
2 jordan divac

Output:
2

Input:
3
3 aleks boba dule
3 pitt angelina divac
2 aleks angelina

1

Input:
3
3 aleks boba dule
3 pitt angelina divac
1 jordan

3

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.