Union of Sets#2927

Union of Sets

1 second
128 megabytes
Very easy (≈850)

Determine the number of distinct numbers that appear in at least one of the given sets.

Input

The first line contains an integer (1 \le n \le 10) — the number of sets.

The next lines describe the sets. Each line begins with (1 \le k \le 1000) — the number of elements in the set. Then integers follow: a_1, \ldots, a_k ( -10^9 \le a_i \le 10^9 ) — the elements of the set.

Output

Output a single number — the number of distinct elements that appear in at least one of the sets.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading