#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, x;
  cin >> n;
  vector<int> mark((1 << 20));
  vector<int> last(20);
  map<int, int> m;
  for (int i = n; i > 0; i--) {
    cin >> x;
    for (int j = 0; j < 20; j++) {
      if (x & (1 << j)) {
        if (last[j]) {
          auto it = m.find(last[j]);
          it->second ^= (1 << j);
          if (!it->second) m.erase(it);
        }
        last[j] = i;
      }
    }
    if (x)
      m[i] = x;
    else
      mark[x] = 1;
    int val = 0;
    for (auto &i : m) {
      val |= i.second;
      mark[val] = 1;
    }
  }
  int cnt = 0;
  for (auto i : mark) cnt += i;
  cout << cnt;
  int meh = 0;
  for (int i = 1000000; i >= 0; i--) meh |= i;
  return 0;
}
