#include <bits/stdc++.h>
using namespace std;
int main() {
  iostream::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  set<int> s1, s2;
  long long a[n];
  for (int i = (0); i < (n); ++i) cin >> a[i];
  vector<int> v;
  for (int i = (0); i < (n); ++i) {
    s1.insert(a[i]);
    s2.insert(a[i]);
    set<int>::iterator it;
    for (it = s1.begin(); it != s1.end(); it++) {
      v.push_back(a[i] | (*it));
      s2.insert(a[i] | (*it));
    }
    s1.clear();
    for (int i = (0); i < (v.size()); ++i) {
      s1.insert(v[i]);
    }
    v.clear();
  }
  cout << s2.size();
}
