#include <bits/stdc++.h>
using namespace std;
const int N = 1e4 + 1;
void solve() {
  int n;
  cin >> n;
  vector<int> ar(n);
  for (auto& x : ar) cin >> x;
  set<int> ans, f, s;
  for (int i = 0; i < n; ++i) {
    s.clear();
    s.insert(ar[i]);
    ans.insert(ar[i]);
    for (auto& x : f) {
      s.insert(x | ar[i]);
      ans.insert(x | ar[i]);
    }
    f.swap(s);
  }
  cout << ans.size();
}
int main() {
  solve();
  return 0;
}
