#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
int main() {
	int q;
	std::cin >> q;
	std::set<int> set;
	for (int i = 0; i < q; ++i) {
		int t, x;
		std::cin >> t >> x;
		switch (t) {
		case 0: set.insert(x);
			std::cout << set.size() << std::endl;
			break;
		default:
			std::cout << set.count(x) << std::endl;
		}
	}
}
