H = [1] + [0] * 32768 input() for e in map(int, input().split()): for i in range(32768): H[e ^ i] |= H[i] print(sum(H))