#include <bits/stdc++.h>
using namespace std;
template <class T>
T abs(T x) {
  return x > 0 ? x : -x;
}
const double eps = 1e-9;
const double pi = acos(-1.0);
const long long inf = 1ll << 60;
const int mod = 1e9 + 7;
int n;
int v[100005];
bool was[1 << 20];
set<int> S;
vector<int> aux;
int main() {
  memset((was), (false), sizeof(was));
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &v[i]);
  for (int i = n - 1; i >= 0; i--) {
    aux.resize((int)(S).size());
    copy((S).begin(), (S).end(), aux.begin());
    S.clear();
    S.insert(v[i]);
    was[v[i]] = true;
    for (int j = 0; j < (int)(aux).size(); j++) {
      if (S.find(aux[j] | v[i]) == S.end()) S.insert(aux[j] | v[i]);
      was[aux[j] | v[i]] = true;
    }
  }
  int ans = 0;
  for (int i = 0; i < (1 << 20); i++) ans += int(was[i]);
  printf("%d\n", ans);
  return 0;
}
