Problem Description

You start with L lives. You get q events: HIT x (lose x) or HEAL x (gain x). The moment lives becomes

Input Format

First line L. Second line q. Next q lines events.

Output Format

One line: processed finalLives.

Sample Test Case

Input:
10 5 HIT 3 HEAL 1 HIT 20 HEAL 5 HIT 1
Output:
3 -12

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next