#include <bits/stdc++.h>
using namespace std;
int n, a;
map<long long, int> m, m1, m2;
map<long long, int>::iterator it;
int main() {
  int i;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a;
    for (it = m2.begin(); it != m2.end(); it++) {
      m[it->first | a]++;
      m1[it->first | a]++;
    }
    m2 = m1;
    m1.clear();
    m[a]++;
    m2[a]++;
  }
  cout << m.size() << endl;
  return 0;
}
