N = int(input()) A = list(map(int,input().split())) dp = [ [0]*16385 for i in range(N+1) ] dp[0][0] = 1 for i in range(N): for j in range(16385): 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,16385): ans += dp[N][i] print(ans)