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