Problem Description

Read opening balance B and m operations. Each operation is: ADD x or SUB x. Output final balance.

Input Format

Line1: B. Line2: m. Next m lines: op x.

Output Format

One integer final balance.

Sample Test Case

Input:
10 4 ADD 5 SUB 2 ADD 1 SUB 20
Output:
-6

Constraints

0

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next