#include <bits/stdc++.h>
using namespace std;
int v[100000];
int nx[100000 + 1][20];
int aux[20];
int main() {
  int n;
  scanf("%d", &n);
  bool h0 = 0;
  for (int i = 0; i < n; ++i) {
    scanf("%d", v + i);
    h0 |= v[i] == 0;
  }
  memset(nx[n], -1, sizeof nx[n]);
  set<int> r;
  for (int i = n - 1; i >= 0; --i) {
    memcpy(nx[i], nx[i + 1], sizeof nx[i]);
    map<int, vector<int> > t;
    for (int j = 0; j < 20; ++j) {
      if (v[i] & (1 << j)) nx[i][j] = i;
      t[nx[i][j]].push_back(j);
    }
    int val = 0;
    for (typeof(t.begin()) it = t.begin(); it != t.end(); ++it) {
      if (it->first < 0) continue;
      vector<int>& v = it->second;
      for (int i = 0; i < v.size(); ++i) val |= 1 << (v[i]);
      r.insert(val);
    }
  }
  printf("%d\n", r.size() + h0);
  return 0;
}
