n = int(input()) A = list(map(int, input().split())) m = 15 tf = [False] * (1 << m) tf[0] = True stack = [0] while stack: x = stack.pop() for a in A: if not tf[a ^ x]: tf[a ^ x] = True stack.append(a ^ x) print(sum(tf))