#!/usr/bin/python M=16384 h=[0]*(M+1) input() a=map(int,input().split()) for e in a: for i in range(M+1): h[e^i]|=h[i] print(sum(h))