#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
struct node {
  int data, pos;
} f[N][30];
int n, m, i, j, k, a[N], x[30], ans, t;
bool b[2000010];
bool cmp(node x, node y) { return x.pos < y.pos; }
bool p() {
  for (int i = 1; i <= n; i++)
    if (a[i] == 0) return true;
  return false;
}
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (i = 0; i <= 20; i++) x[i] = n + 1;
  for (i = 1; i <= n; i++)
    for (j = 0; j <= 20; j++) f[i][j].data = j;
  for (i = n; i >= 1; i--) {
    for (j = 0; j <= 20; j++)
      if ((1 << j) & a[i]) x[j] = i;
    for (j = 0; j <= 20; j++) f[i][j].pos = x[j];
  }
  for (i = 1; i <= n; i++) sort(f[i], f[i] + 21, cmp);
  for (i = 1; i <= n; i++) {
    t = 0;
    for (j = 0; j <= 20; j++) {
      if (f[i][j].pos != n + 1) t += (1 << f[i][j].data);
      if (f[i][j].pos != f[i][j + 1].pos && !b[t]) ans++, b[t] = true;
    }
  }
  if (p() && !b[0]) ans++;
  printf("%d\n", ans);
  return 0;
}
