#C430. Maximize Conducted Events
Maximize Conducted Events
Maximize Conducted Events
You are given a list of citizen-event requests. Each request is a pair of strings, which denote a citizen's name and an event identifier. The task is to determine the maximum number of events that can be conducted under the constraint that no citizen participates in more than one event.
Formally, if we define \(S\) as the set of all requests \((name, event)\), then we need to choose a subset of events such that each citizen appears in at most one event. Notice that this simply requires counting the number of unique citizens in the list.
Input is read from standard input (stdin) and the result (the maximum number of events) should be written to the standard output (stdout).
inputFormat
The first line of input contains an integer \(n\) — the number of citizen-event requests. The next \(n\) lines each contain two strings separated by a space: the citizen's name and the event identifier.
\(1 \leq n \leq 10^5\)
outputFormat
Output a single integer, which is the maximum number of events that can be conducted so that no citizen participates in more than one event.
## sample5
Alice E1
Bob E2
Alice E3
Charlie E4
Bob E5
3