#include <bits/stdc++.h>
using namespace std;
struct Fast { Fast() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20);} } fast;

long long mod = 1000000007;

long long div(long long a, long long b, long long c){
    return b / c - (a - 1) / c;
}

int main(){
    int n, t, x;
    cin >> n;
    set<int> as;
    for(int i = 0; i < n; i++){
        cin >> t >> x;
        if (t == 0){
            as.insert(x);
            cout << as.size() << endl;;
        }else if (as.find(x) != as.end()){
            cout << '1' << endl;
        }else{
            cout << '0' << endl;
        }
    }
}
