num = int(input())
d = {}
result = []
for i in range(num):
a, *b = map(str,input().split(' '))
a = int(a)
if a == 1:
d2 = {b[0]:b[1]}
d.update(d2)
output = 'OK'
result.append(output)
elif a == 2:
if b[0] in d.keys():
output = d[b[0]]
result.append(output)
else:
output = 'Not found'
result.append(output)
elif a == 3:
if b[0] in d.keys():
del d[b[0]]
output = 'Deleted successfully'
result.append(output)
else:
output = 'Not found'
result.append(output)
elif a == 4:
output = str(len(d))
result.append(output)
m = '\n'.join(result)
print(m)