#C6304. Unique Employee Participation Count

    ID: 50050 Type: Default 1000ms 256MiB

Unique Employee Participation Count

Unique Employee Participation Count

You are given data for d consecutive days. For each day, the input contains an integer representing the number of employees that participated followed by their unique IDs. Your task is to report the total number of unique employees over all days.

The input format is as follows:

  • The first line contains an integer d, the number of days.
  • For each of the next d lines, the first number is an integer n representing the count of employee IDs that follow, then n integers follow which are the employee IDs for that day.

Formally, if we denote the employee IDs on day i by a list \(A_i = [a_{i,1}, a_{i,2}, \dots, a_{i,n_i}]\), your task is to compute the value:

\[ \text{result} = |\{ a_{i,j} : 1 \le i \le d, 1 \le j \le n_i \}| \]

where \(|\cdot|\) denotes the cardinality of the set.

It is guaranteed that employee IDs are integers. Note that a day may have no employees participating (in which case the first integer on that line will be 0).

inputFormat

The input is read from standard input (stdin) and is formatted as follows:

  • The first line contains an integer \(d\) denoting the number of days.
  • Each of the following \(d\) lines starts with an integer \(n\) which is the number of employees for that day, followed by \(n\) space-separated integers representing the employee IDs.

outputFormat

Output a single integer to standard output (stdout) which is the total number of unique employee IDs across all days.

## sample
1
1 1
1