#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
int a[N];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  set<int> ans, now;
  for (int i = 0; i < n; i++) {
    int val = a[i];
    vector<int> del;
    ans.insert(val);
    for (set<int>::iterator it = now.begin(); it != now.end(); it++) {
      if ((val | a[-(*it)]) == val)
        del.push_back(*it);
      else {
        val |= a[-(*it)];
        ans.insert(val);
      }
    }
    for (int j = 0; j < del.size(); j++) now.erase(del[j]);
    now.insert(-i);
  }
  cout << ans.size() << endl;
  return 0;
}
