#include using namespace std; bool dp[5555][1<<15]; int n; int a[5555]; int c[1<<15]; void solve(int p, int u) { if (dp[p][u]) return; if (p == n) { c[u] = 1; return; } solve(p+1, u); solve(p+1, u^a[p]); dp[p][u] = 1; } int main(void) { scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%d", a+i); } solve(0, 0); int res = 0; for (int i = 0; i < 1<<15; i++) res += c[i]; printf("%d\n", res); return 0; }