#include<bits/stdc++.h>
using namespace std;
map<string,int>mp;
int main(){
int k;
cin>>k;
string s;
int scr,ope;
for(int i=1;i<=k;++i){
cin>>ope;
if(ope==1){
cin>>s>>scr;
mp[s]=scr;
cout<<"OK\n";
}
else if(ope==2){
cin>>s;
if(mp.count(s)==0){
cout<<"Not found\n";
}
else cout<<mp[s]<<endl;
}
else if(ope==3){
if(mp.count(s)==0){
cout<<"Not found\n";
}
else{
cout<<"Deleted successfully\n";
mp.erase(mp.find(s));
}
}
else if(ope==4){
cout<<mp.size()<<endl;
}
}
}