#include <bits/stdc++.h>
using namespace std;
const long double pi = acos(-1.0);
const long double eps = 1e-9;
int n;
int m;
int k;
vector<int> a;
set<pair<int, int> > s[21];
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int t;
    cin >> t;
    a.push_back(t);
    for (int j = 0; j < 21; ++j) {
      if ((1 << j) & t) {
        s[j].insert(make_pair(i, t));
      }
    }
  }
  set<int> ans;
  for (int i = 0; i < n; ++i) {
    ans.insert(a[i]);
    set<pair<int, int> > loc;
    for (int j = 0; j < 21; ++j) {
      set<pair<int, int> >::iterator it =
          s[j].lower_bound(make_pair(i, (a[i])));
      if (it != s[j].end()) {
        if ((*it) != make_pair(i, a[i])) {
          loc.insert(make_pair(it->first, j));
        }
      }
    }
    int f = 0;
    for (set<pair<int, int> >::iterator it = loc.begin(); it != loc.end();
         it++) {
      f = f | a[it->first];
      ans.insert(a[i] | f);
    }
  }
  cout << ans.size();
  return 0;
}
