t = int(input())
sum = 0
for i in range(t):
    inp = list(map(str, input().split()))
    if inp[0] == 'report':
        print(sum)
    else:
        sum += int(inp[1])

828e959b2a0b323bf08deaaf8696be99a97d2f03
<mask token>

<mask token>
for i in range(t):
    inp = list(map(str, input().split()))
    if inp[0] == 'report':
        print(sum)
    else:
        sum += int(inp[1])

t = int(input())
sum = 0
for i in range(t):
    inp = list(map(str, input().split()))
    if inp[0] == 'report':
        print(sum)
    else:
        sum += int(inp[1])
