#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[100005], cnt = 0;
  set<int> s, pr;
  set<int>::iterator it;
  vector<int> v;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    for (it = s.begin(); it != s.end(); it++) v.push_back(*it);
    s.clear();
    s.insert(a[i]);
    if (pr.find(a[i]) == pr.end()) pr.insert(a[i]);
    for (int j = 0; j < v.size(); j++) {
      s.insert(v[j] | a[i]);
      if (pr.find(v[j] | a[i]) == pr.end()) pr.insert(v[j] | a[i]);
    }
    v.clear();
  }
  cout << pr.size() << endl;
}
