#include "bits/stdc++.h"
using namespace std;
#define long int64_t

int main() {
	ios_base::sync_with_stdio( false );

	set<int> S;
	int q;
	cin >> q;
	while( q-- > 0 ) {
		int a, b;
		cin >> a >> b;
		if( a == 0 ) {
			S.insert( b );
			cout << S.size() << '\n';
		}
		else if( a == 1 ) {
			cout << (S.find( b ) != S.end()) << '\n';
		}
	}

	return 0;
}

