#include <bits/stdc++.h>
using namespace std;
const int INF = 1E9 + 7;
template <class C>
void mini(C& a4, C b4) {
  a4 = min(a4, b4);
}
template <class C>
void maxi(C& a4, C b4) {
  a4 = max(a4, b4);
}
int main() {
  int n;
  int arr[100100];
  set<int> nom;
  set<int> ans;
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> arr[i];
  nom.insert(arr[0]);
  for (int i = 1; i < n; ++i) {
    set<int> tem;
    for (set<int>::iterator it = nom.begin(); it != nom.end(); ++it) {
      tem.insert(*it | arr[i]);
    }
    tem.insert(arr[i]);
    for (set<int>::iterator it = nom.begin(); it != nom.end(); ++it)
      ans.insert(*it);
    nom = tem;
  }
  for (set<int>::iterator it = nom.begin(); it != nom.end(); ++it)
    ans.insert(*it);
  cout << ans.size() << endl;
}
