import sys def input(): return sys.stdin.readline().rstrip('\n') def main(): n = int(input()) d = [False]*(2**15) d[0] = True *a, = map(int, input().split()) for v in a: if not d[v]: for i in range(len(d)): if d[i]: d[i ^ v] = True print(sum(d)) if __name__ == '__main__': main()