#include <bits/stdc++.h>
using namespace std;
int a[100023];
set<int> s1, s2;
set<int> ans;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    s2.clear();
    s2.insert(a[i]);
    for (auto it = s1.begin(); it != s1.end(); it++) {
      s2.insert((*it) | a[i]);
      ans.insert(*it);
    }
    s1 = s2;
  }
  for (auto it = s1.begin(); it != s1.end(); it++) ans.insert(*it);
  cout << ans.size() << endl;
  return 0;
}
