N=int(input()) A=list(map(int,input().split())) T=1<<(N-1).bit_length() DP=[0]*(2*T) DP[0]=1 for a in A: for i in range(2*T): DP[i^a]|=DP[i] print(sum(DP))