#include #include using namespace std; #define MAX (1<<15) bool now[MAX]; bool nex[MAX]; int main() { int N; cin >> N; vector A(N); for (int i = 0; i < N; i++) { cin >> A[i]; } int ans = 0; now[0] = true; for (int i = 0; i < N; i++) { for (int j = 0; j < MAX; j++) { if (now[j]) { int num = j ^ A[i]; nex[num] = true; } nex[j] |= now[j]; } for (int j = 0; j < MAX; j++) { now[j] |= nex[j]; } } for (int i = 0; i < MAX; i++) { if (now[i]) ans++; } cout << ans << endl; //cout << (1ll << ans) << endl; }