#C6021. Maximum Active Processes

    ID: 49736 Type: Default 1000ms 256MiB

Maximum Active Processes

Maximum Active Processes

You are given a sequence of requests, each represented by a pair of integers: a timestamp t and a process identifier id. For each request, the state of the process id is toggled: if it is inactive it becomes active, and if it is active it terminates (is removed from the active set). Your task is to simulate this toggle process in the order of requests and determine the maximum number of processes that were active simultaneously at any point.

Formally, let Si be the set of active processes after processing the first i requests. You need to compute:

max0inSi,\max_{0 \le i \le n} |S_i|,

where |Si| denotes the cardinality (size) of the set after the i-th request.

inputFormat

The input is given via stdin in the following format:

n
 t1 id1
 t2 id2
 ...
 tn idn

Here, n is the number of requests. Each of the next n lines contains two integers: the timestamp t and the process identifier id.

outputFormat

Output a single integer to stdout — the maximum number of processes that were active simultaneously.

## sample
1
0 1
1

</p>