Problem Description

Read a tiny language with commands: 'let x', 'block', 'end'. Each block makes a new scope. Count how many times a let shadows a variable from an outer scope.

Input Format

First line n. Next n lines commands.

Output Format

One integer shadowCount.

Sample Test Case

Input:
7 let a block let a let b block let b end
Output:
2

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next