#include<stdio.h>
#include<stdio.h>
#define MAX_EMPLOYEE_ID 100000
int main(){
    int q;
    scanf("%d", &q);
    int attendance[MAX_EMPLOYEE_ID + 1] = {0};
    for(int i = 0; i < q; i++){
        int query_type, empID;
        scanf("%d", &query_type);
        if(query_type < 1 || query_type > 4){
            printf("Invalid input\n");
            continue;
        }
        if(query_continue_type == 1 || query_type == 2 || query_type == 3){
            scanf("%d", &empID);
            if(empID < 1 || empID > MAX_EMPLOYEE_ID){
                printf("Invalid input\n");
                continue;
            }
        }
        switch(query_type){
            case 1:
            attendance[empID] = 1;
            break;
            case 2:
            attendance[empID] = 0;
            break;
            case 3:
            if(attendance[empID] == 1){
                printf("Present\n");
            } else {
                printf("Not Present\n");
            } break ;
            case 4:{
                int count = 0;
                for(int j = 1; j <= MAX_EMPLOYEE_ID; j++){
                    if(attendance[j] == 1){
                        count++;
                    }
                }
                printf("%d\n", count);
                break;
            }
            default:
            printf("Invalid input\n");
        }
    }
    return 0;
}