#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
int main() {
  set<int> res, subres, subres2;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    subres2.clear();
    subres.insert(x);
    for (typeof((subres).end()) it = (subres).begin(); it != (subres).end();
         it++)
      subres2.insert(x | (*it));
    subres = subres2;
    for (typeof((subres).end()) it = (subres).begin(); it != (subres).end();
         it++)
      res.insert(*it);
  }
  cout << res.size() << endl;
  return 0;
}
