import java.io.*;
import java.util.*;
public class Main{
public static void main(String[] args) throws IOException{
Scanner sc=new Scanner(System.in);
PrintWriter pw=new PrintWriter(new OutputStreamWriter(System.out));
int n=sc.nextInt();
Map<String,Integer> map=new HashMap<>();
for (int i = 0; i < n; i++) {
int x=sc.nextInt();
if (x==1) {
String str=sc.next();
int q=sc.nextInt();
if (map.containsKey(str)){
map.put(str,q);
}
else {
map.put(str,q);
pw.println("OK");
}
}else
if (x==2){
String str=sc.next();
if (map.containsKey(str)){
pw.println(map.get(str));
}else pw.println("Not found");
}
else if (x==3){
String str=sc.next();
if (map.containsKey(str)){
map.remove(str);
pw.println("Deleted successfully");
}
else pw.println("Not found");
}
else pw.println(map.size());
}
pw.flush();
}
}