N = int(input()) A = list(map(int,input().split())) C = 1 << 15 dp = [0] * (C + 1) dp[0] = 1 for a in A: nx = dp.copy() for i in range(C+1): if dp[i]: nx[i^a] = 1 dp = nx print(sum(dp))