#include <bits/stdc++.h>
using namespace std;
const int N = 100100;
vector<int> vc;
int ps[N][22], a[N], n;
bool mark[20 * N];
int get(int r, int l) {
  int ans(0);
  for (int i = 0; i < 20; i++)
    if ((l && ps[r][i] > ps[l - 1][i]) || (!l && ps[r][i])) ans += (1 << i);
  return ans;
}
void TS(int st, int en, int loc) {
  if (st + 1 >= en) {
    int a = get(st, loc), b = get(en, loc);
    if (a != b) vc.push_back(b);
    return;
  }
  int a = get(st, loc), b = get(en, loc), mid = (st + en) / 2,
      c = get(mid, loc);
  if (c != a) TS(st, mid, loc);
  if (c != b) TS(mid, en, loc);
  return;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int ans(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    for (int j = 0; j < 20; j++) {
      if (((1 << j) & a[i])) ps[i][j]++;
      if (i) ps[i][j] += ps[i - 1][j];
    }
  }
  for (int i = 0; i < n; i++) {
    TS(i, n - 1, i);
    vc.push_back(a[i]);
  }
  for (int u : vc) {
    mark[u] = 1;
  }
  for (int i = 0; i <= 2000000; i++) ans += mark[i];
  cout << ans << endl;
  return 0;
}
