Problem Description

Create BankAccount with deposit/withdraw. Withdraw that goes below 0 is ignored. Print final balance.

Input Format

First line q. Next q lines: DEPOSIT x or WITHDRAW x.

Output Format

One integer balance.

Sample Test Case

Input:
4 DEPOSIT 100 WITHDRAW 30 WITHDRAW 100 DEPOSIT 10
Output:
80

Constraints

q

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next