Problem Description

You will receive n statements in a tiny language: 'set x v' or 'add x y' meaning x = x + y. If add uses a variable that was never set before (for x or y), count it as a bad read. Output badReadCount.

Input Format

First line n. Next n lines statements.

Output Format

One integer badReadCount.

Sample Test Case

Input:
4 add a b set a 1 add a b set b 2
Output:
2

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next