e-olymp
Competitions

PP2: Week 9,10: May 17 - 30

Sets Union

Sets union is very difficult. Therefore find the amount of numbers that present in at least one of the given sets.

Input

The first line contains the number of sets n (1n10). The next n lines contain the sets in format: ka1 ... ak (1k1000, -109ai109).

Output

Print the amount of numbers that present in at least one of the given sets.

Time limit 1 second
Memory limit 128 MiB
Input example #1
1
1 -606037695
Output example #1
1
Input example #2
2
1 -822866455
1 503976630
Output example #2
2
Input example #3
2
3 1 2 3
3 2 4 3
Output example #3
4