#K62332. Unique Postal Codes

    ID: 31508 Type: Default 1000ms 256MiB

Unique Postal Codes

Unique Postal Codes

You are given batches of postal codes. Each batch is represented on a separate line, starting with an integer \(n\) that indicates the number of postal codes in that batch, followed by \(n\) postal code integers. Your task is to determine the total number of unique postal codes across all batches.

Input Format: The input begins with an integer \(T\) — the number of batches. Then \(T\) lines follow. Each line begins with an integer representing the count of postal codes in that batch, followed by the postal codes themselves.

Output Format: Output a single integer representing the number of unique postal codes.

inputFormat

The input is read from standard input (stdin) and has the following structure:

T
n1 code1 code2 ... code_n1
n2 code1 code2 ... code_n2
...
Tn code1 code2 ... code_nT

Where:

  • \(T\) is the number of batches.
  • Each batch starts with an integer \(n_i\) that indicates the number of postal codes in that batch, followed by \(n_i\) postal codes.

outputFormat

Print a single integer to standard output (stdout) representing the total number of unique postal codes found across all batches.

## sample
1
5 101 202 303 404 505
5