Problem Description

Start value=0. Commands: ADD x, SUB x, MUL x, DIV x (integer, ignore if x=0). Print final value.

Input Format

First line q. Next q lines commands.

Output Format

One integer final value.

Sample Test Case

Input:
5 ADD 10 MUL 3 SUB 4 DIV 2 DIV 0
Output:
13

Constraints

q

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next