#include <bits/stdc++.h>
using namespace std;
map <string,int> ds;
int main(){
int n,opt,num,ans;
string name;
cin >> n;
while (n--){
cin >> opt;
if (opt == 1){
cin >> name >> num;
ds[name]=num;
cout << "OK" << endl;
}else if (opt == 2){
cin >> name;
if (ds.find(name)!=ds.end()) cout << ds[name] << endl;
else cout << "Not found";
}else if (opt == 3){
if (ds.find(name)!=ds.end()){
ds.erase(ds.find(name));
cout << "Deleted successfully" << endl;
}else cout << "Not found" << endl;
}else cout << ds.size() << endl;
}
}