N, *A = map(int, open(0).read().split()) X = 0 dp = [0] * (1 << 15) dp[0] = 1 for i in range(N): for j in range(1 << 15): if dp[j]: dp[A[i] ^ j] = 1 print(sum(dp))