def solve(): N = int(input()) A = list(map(int, input().split())) for i in range(N): a = A[i] if a: h = 1 << highest(a) for j in range(i + 1, N): if A[j] & h: A[j] ^= h print(1 << sum(1 for a in A if a)) def main(): solve() def bitcount(x): """ 立っているbitの数 """ x = (x & 0x5555555555555555) + (x >> 1 & 0x5555555555555555) x = (x & 0x3333333333333333) + (x >> 2 & 0x3333333333333333) x = (x & 0x0f0f0f0f0f0f0f0f) + (x >> 4 & 0x0f0f0f0f0f0f0f0f) x = (x & 0x00ff00ff00ff00ff) + (x >> 8 & 0x00ff00ff00ff00ff) x = (x & 0x0000ffff0000ffff) + (x >> 16 & 0x0000ffff0000ffff) return (x & 0x00000000ffffffff) + (x >> 32 & 0x00000000ffffffff) def highest(x): """ 一番左の立っているbitの位置 """ x |= (x >> 1) x |= (x >> 2) x |= (x >> 4) x |= (x >> 8) x |= (x >> 16) x |= (x >> 32) return bitcount(x) - 1 if __name__ == '__main__': main()