#include <bits/stdc++.h>
using namespace std;
int n, i, j, v[100005], m[25][100005], rasp;
vector<int> s;
int main() {
  ios::sync_with_stdio(0);
  cin >> n;
  for (i = 1; i <= n; ++i) {
    cin >> v[i];
  }
  for (int i = 0; i <= 20; ++i) m[i][n + 1] = n + 1;
  for (i = n; i; --i) {
    for (j = 0; j <= 20; ++j) m[j][i] = m[j][i + 1];
    for (j = 0; j <= 20; ++j)
      if (v[i] & (1 << j)) {
        m[j][i] = i;
      }
  }
  for (i = 1; i <= n; ++i) {
    int vl = v[i];
    int pos = i;
    while (pos < n + 1) {
      s.push_back(vl);
      int mn = n + 1;
      for (int j = 0; j <= 20; ++j)
        if (m[j][pos] > pos && (((1 << j) & vl) == 0)) mn = min(m[j][pos], mn);
      vl |= v[mn];
      pos = mn;
    }
  }
  sort(s.begin(), s.end());
  s.erase(unique(s.begin(), s.end()), s.end());
  cout << int(s.size()) << '\n';
  return 0;
}
