#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  map<long long, bool>::iterator it;
  long long i, A[100001], n;
  map<long long, bool> N, G, P;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> A[i];
  }
  G[A[0]] = true;
  P[A[0]] = true;
  for (i = 0; i < n; i++) {
    for (it = P.begin(); it != P.end(); it++) {
      N[it->first | A[i]] = true;
      G[it->first | A[i]] = true;
    }
    N[A[i]] = true;
    G[A[i]] = true;
    P = N;
    N.clear();
  }
  cout << G.size();
  return 0;
}
