#include using namespace std; using ll = long long; using P = pair; const int INF = 1e9; const int MOD = 1e9 + 7; // 4近傍、8近傍 int dx[] = {1, 0, -1, 0, 1, -1, -1, 1}; int dy[] = {0, 1, 0, -1, 1, 1, -1, -1}; int flag[50000]; int main() { int N; cin >> N; int a[N]; for (int i = 0; i < N; i++) cin >> a[i]; flag[0] = 1; for (int i = 0; i < N; i++) { for (int j = 50000; j >= 0; j--) { if (flag[j]) { flag[j^a[i]] = 1; } } } cout << accumulate(flag, flag + 50000, 0) << endl; return 0; }