import sys,random,bisect from collections import deque,defaultdict,Counter from heapq import heapify,heappop,heappush from itertools import cycle, permutations from math import log,gcd input = lambda :sys.stdin.readline().rstrip() mi = lambda :map(int,input().split()) li = lambda :list(mi()) N = int(input()) A = li() res = 1 for i in range(30): x,y = 0,0 for a in A: if a>>i & 1: x += 1 else: y += 1 if x*y >= 1: res *= 2 print(res)