Union of Sets#2927

Union of Sets

1 секунда
128 мегабајтова
Врло лако

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

Улаз

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 a single number — the number of distinct elements that appear in at least one of the sets.

Примери

Пример 1

Loading
Loading

Пример 2

Loading
Loading