eolymp
bolt
Try our new interface for solving problems

Barge

Time limit 1 second
Memory limit 64 MiB

The barge is K cargo compartments. Each compartment can put some drums with one of the 10000 kinds of fuel. And remove the barrel from the section can only be the case if all the barrels are placed in this compartment after it had already been extracted. Thus, at a time in every non-empty compartment there is exactly one barrel that can be extracted without disturbing the others. We call such extreme flanks.

Initially, the barge is empty. Then she swims through the N series of docks, and in each of the dock to the barge sinks or barrel with some sort of fuel in a compartment, or is discharged from the extreme flank of a compartment. However, if the specified slot is empty or if the barrel has uploaded the wrong type of fuel, which is expected to be to fix the error. If the barge is loaded with barrels or more than P if after going through all the docks it was empty, it should also fix the error. All you need to either specify the maximum number of barrels that remained at the same time on a barge or fix the error.

Input data

The first line of three integers N, K and P (1N, K, P100000). This is followed by N lines describing the action performed in the next dock. If it is loaded, the string has the form + A B, where A - number compartment, which is placed in a barrel, and B - number of fuel in it. If the dock is engaged in dumping, the line has the form - A B, where A - number of bays from which to extract a barrel, and B - number of expected fuel.

Output data

Derive a single number, equal to the desired maximum error-free passage in case of barge route, or get the word Error in the opposite case.

Examples

Input example #1
10 1 5
+ 1 1
+ 1 2
+ 1 3
+ 1 4
+ 1 5
- 1 5
- 1 4
- 1 3
- 1 2
- 1 1
Output example #1
5