from collections import deque class mf_graph: n=1 g=[[] for i in range(1)] pos=[] def __init__(self,N): self.n=N self.g=[[] for i in range(N)] self.pos=[] def add_edge(self,From,To,cap): assert 0<=From and From0): v=que.popleft() for e in self.g[v]: if e["cap"]==0 or level[e["to"]]>=0:continue level[e["to"]]=level[v]+1 if e["to"]==t:return que.append(e["to"]) def dfs(func,v,up): if (v==s):return up res=0 level_v=level[v] for i in range(Iter[v],len(self.g[v])): e=self.g[v][i] if (level_v<=level[e["to"]] or self.g[e["to"]][e["rev"]]["cap"]==0):continue d=func(func,e["to"],min(up-res,self.g[e["to"]][e["rev"]]["cap"])) if d<=0:continue self.g[v][i]["cap"]+=d self.g[e["to"]][e["rev"]]["cap"]-=d res+=d if res==up:return res level[v]=self.n return res flow=0 while(flow0): p=que.popleft() visited[p]=True for e in self.g[p]: if e["cap"] and not(visited[e["to"]]): visited[e["to"]]=True que.append(e["to"]) return visited def bc(x): res=0 for i in range(30): res+=(x>>i)&1 return res%2 n=int(input()) a=[0]+list(map(int,input().split())) ng=set() for i in range(30): ng.add(2**i) g=mf_graph(n+3) for i in range(1,n+1): for j in range(i+1,n+1): if not a[i]^a[j] in ng:continue if bc(a[i])==0:g.add_edge(i,j,1) else:g.add_edge(j,i,1) for i in range(1,n+1): if bc(a[i])==0: g.add_edge(0,i,1) else: g.add_edge(i,n+1,1) ans=0 print(n-ans)