#include <bits/stdc++.h>
using namespace std;
int n;
string name;
int opt, score;
unordered_map<string, int> _map;
int main() {
cin >> n;
while (n--) {
cin >> opt;
switch (opt) {
case 1:
cin >> name >> score;
_map[name] = score;
cout << "OK" << endl;
break;
case 2:
cin >> name;
if (_map.count(name) > 0) cout << _map[name] << endl;
else cout << "Not found" << endl;
break;
case 3:
cin >> name;
if (_map.count(name) > 0) _map.erase(name), cout << "Deleted successfully" << endl;
else cout << "Not found" << endl;
break;
case 4:
cout << _map.size() << endl;
break;
}
}
return 0;
}