#include <bits/stdc++.h>
using namespace std;
int a[100001];
bool c[1 << 20 + 1];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
  set<int> ss, ts;
  for (int i = 0; i < n; ++i) {
    ts = ss;
    ss.clear();
    for (set<int>::iterator it = ts.begin(); it != ts.end(); it++)
      ss.insert((*it) | a[i]);
    ss.insert(a[i]);
    for (set<int>::iterator it = ss.begin(); it != ss.end(); it++) c[*it] = 1;
  }
  long long res = count(c, c + (1 << 20), true);
  printf("%I64d", res);
  return 0;
}
