#include <bits/stdc++.h>
using namespace std;
int n, a[100010];
int r[22][100010];
void go() {
  set<int> have;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int d = 0; d < 20; d++) {
    int t = n;
    for (int i = n - 1; i >= 0; i--) {
      r[d][i] = t;
      if ((a[i] >> d) & 1) t = i;
    }
  }
  int ans = 0;
  for (int st = 0; st < n; st++) {
    int now = st, x = a[now];
    if (!have.count(x)) {
      ans++;
      have.insert(x);
    }
    while (true) {
      int next = n;
      for (int d = 0; d < 20; d++) {
        if (((x >> d) & 1) == 0) next = min(next, r[d][now]);
      }
      if (next == n) break;
      now = next;
      x = x | a[now];
      if (!have.count(x)) {
        ans++;
        have.insert(x);
      }
    }
  }
  printf("%d\n", ans);
}
int main() {
  go();
  return 0;
}
