#include <bits/stdc++.h>
using namespace std;
int bp[22][111111];
int main() {
  int n;
  while (cin >> n) {
    vector<int> a;
    a.resize(n);
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    for (int p = 0; p < 20; p++) {
      int s = 1 << p;
      int la = (a[0] & s) ? 0 : -1;
      for (int i = 1; i < n; i++) {
        bp[p][i] = la;
        if (a[i] & s) la = i;
      }
    }
    set<int> s;
    s.insert(a[0]);
    for (int i = 1; i < n; i++) {
      int t = a[i];
      s.insert(t);
      vector<pair<int, int> > v;
      for (int p = 0; p < 20; p++) {
        if (bp[p][i] != -1) v.push_back(pair<int, int>(bp[p][i], p));
      }
      sort(v.begin(), v.end());
      reverse(v.begin(), v.end());
      for (int j = 0; j < v.size(); j++) {
        t |= a[v[j].first];
        s.insert(t);
      }
    }
    cout << s.size() << endl;
  }
  return 0;
}
