def solve(): N = int(input()) A = list(map(int, input().split())) for i in range(N): a = A[i] if a: for j in range(i + 1, N): if A[j] & a == a: A[j] ^= a print(1 << sum(1 for a in A if a)) def main(): solve() if __name__ == '__main__': main()