Problem Description

Create Item with qty. Commands: ADD x, SELL x (cannot go below 0). Print final qty.

Input Format

First line q. Next q lines.

Output Format

One integer qty.

Sample Test Case

Input:
5 ADD 10 SELL 3 SELL 20 ADD 5 SELL 2
Output:
10

Constraints

q

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next