n = int(input()) a = list(map(int,input().split())) #dp[i][j] = i番目まで,jを作ることができるか dp = [[False]*(pow(2,15)+1) for i in range(n)] dp[0][0] = True dp[0][a[0]] = True for i in range(1,n): for j in range(pow(2,14)+1): dp[i][j] = dp[i-1][j] or dp[i-1][j^a[i]] ans = 0 for i in range(pow(2,15)+1): if dp[-1][i]: ans += 1 print(ans)