#include using namespace std; using ull = uint64_t; int main() { int n; cin >> n; ull t = (ull(1) << 63) - 1; for (int i = 0; i < n; i++) { ull a; cin >> a; t &= ~a; } for (int i = 0;; i++) { if (t & (ull(1) << i)) { cout << (ull(1) << i) << "\n"; return 0; } } }