#include using namespace std; const int N = 110; typedef long long ll; int n; ll a[N]; int main() { scanf("%d",&n); for(int i = 1;i <= n;i ++ ) scanf("%lld",&a[i]); ll sum = 0; for(int i = 1;i <= n;i ++ ) sum |= a[i]; int x = 0; for(x = 0; ; x ++) { if((sum & 1) == 0) break; sum >>= 1; } ll ans = 1ll << x; printf("%lld\n",ans); return 0; }