int input for in range list input split -1 print if add for in range i

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
N = int(input())
A = []
for i in range(N):
x = list(input().split())
a = x[0]
b = x[1]
c = x[-1]
#print(a,b,c)
if a == 'add':
for j in range(int(b)):
A.append(c)
elif a == 'delete':
for j in range(int(b)):
A.pop(-1)
elif a == 'get':
print(A.count(c))