Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- num = 0
- changed = False
- changedNum = 0
- for i in range(0, 2 * n):
- command = input()
- if command == 'remove':
- num -= 1
- if changed:
- changedNum += 1
- changed = False
- else:
- boxNum = int(command.split(' ')[1])
- if num == 0:
- minNum = boxNum
- if boxNum > minNum:
- changed = True
- num += 1
- print(changedNum)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement