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