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