N = int(input()) A = list(map(int, input().split())) cnt = 0 for i in range(62): cnt += any((a >> i) & 1 for a in A) cnt = min(len(set(A)), cnt) print(pow(2, cnt))