import sys stdin=sys.stdin ip=lambda: int(sp()) fp=lambda: float(sp()) lp=lambda:list(map(int,stdin.readline().split())) tp=lambda:tuple(map(int,stdin.readline().split())) sp=lambda:stdin.readline().rstrip() yp=lambda:print('Yes') np=lambda:print('No') n=ip() a=lp() dp0=[-1 for _ in range(2**15+1)] dp1=[-1 for _ in range(2**15+1)] dp0[0]=0 for i in range(n): for j in range(2**15+1): if dp0[j]!=-1: dp1[j]=1 now=j^a[i] dp1[j^a[i]]=1 dp0=dp1 dp1=[-1 for _ in range(2**15+10)] ans=0 for u in range(2**15+10): if dp0[u]!=-1: ans+=1 print(ans)