N = int(input()) A = set(map(int, input().split())) for i in range(100): if not any((a >> i) & 1 for a in A): print(1 << i) exit()