#include using namespace std; int n, k = 0; long long a; int main(){ cin >> n; for(int i = 0; i < n; i++){ cin >> a; while(a & (1ull << k)) k++; } cout << (1ull << k) << endl; }