n = int(input()) a = list(set(map(int, input().split()))) n = len(a) # ver2 DP dp = [[False]*(2**14+1) for i in range(n+1)] dp[0][0] = True for i in range(n): for k in range(2**14+1): if dp[i][k]: dp[i+1][k^a[i]] = True dp[i+1][k] = True print(sum(dp[-1]))