#include <bits/stdc++.h>

using namespace std;
set<int> s;
set<int>::iterator it;
int main()
{
    
    int n, q, x;
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> q;
        switch (q)
        {
        case 0:
            cin >> x;
            s.insert(x);
            cout << s.size() << endl;
            break;

        case 1:
            cin >> x;
            it = s.find(x);
            (it != s.end()) ? cout << 1 << endl : cout << 0 << endl;
            break;
        }
    }

    return 0;
}

