#include using namespace std; int main() { int N; cin >> N; vectortmp(61); for(int i = 0; i < N; i++) { long long A; cin >> A; for(int j = 0; j <= 60; j++) { if(1 & (A >> j)) { tmp[j] = 1; } } } for(int j = 0; j <= 60; j++) { if(tmp[j] == 0) { cout << (1LL << j) << endl; return 0; } } }