#C10609. Counting Unique Product Codes

    ID: 39833 Type: Default 1000ms 256MiB

Counting Unique Product Codes

Counting Unique Product Codes

You are given a list of product codes. Your task is to determine how many product codes appear exactly once in the list.

In other words, for each product code you need to count its occurrences and then count all codes that appear only once.

For example, given the list of 6 codes:

abc123
xyz789
abc123
def456
xyz789
ghi012

Only def456 and ghi012 appear exactly once, hence the answer is 2.

Input Format: The first line contains an integer \( n \) which represents the number of product codes. The following \( n \) lines each contain a product code (a non-empty string).

Output Format: Output a single integer denoting the number of unique product codes.

inputFormat

The input is given from stdin and is structured as follows:

  1. The first line contains an integer \( n \) (\(1 \leq n \leq 10^5\)) representing the number of product codes.
  2. The next \( n \) lines each contain a product code string.

outputFormat

The output should be written to stdout and consist of a single integer: the count of product codes that appear exactly once in the input.

## sample
6
abc123
xyz789
abc123
def456
xyz789
ghi012
2