#include using namespace std; #define DUMP(x) cerr << #x << "=" << x << endl #define DUMP2(x, y) cerr<<"("<<#x<<", "<<#y<<") = ("< >(x) #define rep(i,n) for(int i=0;i<(int)(n);i++) #define REP(i,m,n) for (int i=m;i<(int)(n);i++) #define in_range(x, y, w, h) (0<=(int)(x) && (int)(x)<(int)(w) && 0<=(int)(y) && (int)(y)<(int)(h)) #define ALL(a) (a).begin(),(a).end() typedef long long ll; const int INF = 1e9; const ll INFLL = 1e18; typedef pair PII; int dx[4]={0, -1, 1, 0}, dy[4]={-1, 0, 0, 1}; bool dp[2][(1<<14)+1]; int main() { ios::sync_with_stdio(false); int N; cin >> N; dp[0][0] = true; rep(i, N) { int A; cin >> A; for (int j=0; j<=1<<14; j++) { dp[(i+1)&1][j] |= dp[i&1][j]; if (dp[i&1][j]) { dp[(i+1)&1][A^j] = true; } } } ll ans = 0; rep(i, (1<<14)+1) { ans += dp[N&1][i]; #ifdef DEBUG if (i < 1<<4) cerr << i << " " << dp[N&1][i] << endl; #endif } cout << ans << endl; }