N = int(input()) A = list(map(int, input().split())) dp = [False] * (2**15+10) dp[0] = True for i in range(N): for j in range(2**15): if dp[j]: dp[A[i]^j] = True ans = sum(dp) print(ans)