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