#include <bits/stdc++.h>
void fileio_in_out() {
  freopen(".in", "r", stdin);
  freopen(".out", "w", stdout);
}
void fileio_txt() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
int n, ans = 0, t1, t2;
int i, j, k, l;
int a[1111111], b[2222222];
void add(int k) {
  if (!b[k]) {
    b[k] = 1;
    ans++;
  }
}
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  memset(b, 0, sizeof(b));
  for (i = 1; i <= n; i++) {
    add(a[i]);
    t1 = t2 = a[i];
    for (j = i + 1; j <= n; j++) {
      t1 -= t1 & a[j];
      if (t1 == 0) break;
      t2 |= a[j];
      add(t2);
    }
  }
  printf("%d\n", ans);
  return 0;
}
