#C1973. Unique Fruits

    ID: 45237 Type: Default 1000ms 256MiB

Unique Fruits

Unique Fruits

You are given several baskets containing fruits represented by unique integers. Each basket is described on a separate line: the first integer indicates the number of fruits in that basket followed by the fruit identifiers. Your task is to compute the total number of distinct fruit types present in all baskets.

The input is provided via stdin and your program should output the result to stdout.

Note: Make sure to consider all baskets and count each fruit type only once.

inputFormat

The first line contains an integer \(n\), the number of baskets. Each of the following \(n\) lines begins with an integer \(k\) which indicates the number of fruits in that basket, followed by \(k\) space-separated integers representing the fruit types.

Input is read from stdin.

outputFormat

Output a single integer indicating the number of distinct fruit types across all baskets. The output should be printed to stdout.

## sample
3
2 1 2
3 2 3 4
1 5
5