#include <bits/stdc++.h>
using namespace std;
const int mxn = 100010, mxlg = 22, mxnd = 2000005;
int a[mxn], n, lg = 20;
bool vis[mxnd];
int ql[100], pl, qr[100], pr;
void sol(int l, int r) {
  if (l == r) {
    vis[a[l]] = 1;
    return;
  }
  int mi = (l + r) / 2;
  sol(l, mi);
  sol(mi + 1, r);
  int nw = 0;
  pl = pr = 0;
  for (int i = mi; i >= l; i--) {
    if ((nw | a[i]) != nw) {
      nw |= a[i];
      ql[++pl] = nw;
    }
  }
  nw = 0;
  for (int i = mi + 1; i <= r; i++) {
    if ((nw | a[i]) != nw) {
      nw |= a[i];
      qr[++pr] = nw;
    }
  }
  for (int i = 1; i <= pl; i++)
    for (int j = 1; j <= pr; j++) {
      vis[ql[i] | qr[j]] = 1;
    }
}
int main() {
  int i;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  memset(vis, 0, sizeof(vis));
  sol(1, n);
  int ans = 0;
  for (i = 0; i <= 1100000; i++)
    if (vis[i]) ans++;
  printf("%d\n", ans);
  return 0;
}
