Competitions

# Set + Multiset

# 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** (**1** ≤ **n** ≤ **10**). The next **n** lines contain the sets in format: **k**`a`

... _{1}`a`

(_{k}**1** ≤ **k** ≤ **1000**, `-10`

≤ ^{9}`a`

≤ _{i}`10`

).^{9}

#### Output

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

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