#include <bits/stdc++.h>
using namespace std;
int st[444444];
int a[444444];
void build(int i, int l, int r) {
  if (l + 1 == r) {
    st[i] = a[l];
  } else {
    int m = (l + r) >> 1;
    build(i * 2 + 1, l, m);
    build(i * 2 + 2, m, r);
    st[i] = st[i * 2 + 1] | st[i * 2 + 2];
  }
}
int get(int i, int l, int r, int ql, int qr) {
  if (r <= ql || l >= qr) {
    return 0;
  }
  if (ql <= l && r <= qr) {
    return st[i];
  }
  int m = (l + r) >> 1;
  return get(i * 2 + 1, l, m, ql, qr) | get(i * 2 + 2, m, r, ql, qr);
}
int getl(int i, int l, int r, int qi, int qx, int& cur) {
  if (r <= qi) {
    return -1;
  }
  if (l >= qi && (st[i] | cur) <= qx) {
    cur |= st[i];
    return -1;
  }
  if (l + 1 == r) {
    cur |= st[i];
    if (cur > qx) {
      return l;
    }
    return -1;
  }
  int m = (l + r) >> 1;
  int t = getl(i * 2 + 1, l, m, qi, qx, cur);
  if (t == -1) {
    t = getl(i * 2 + 2, m, r, qi, qx, cur);
  }
  if (l >= qi) {
    cur |= st[i];
  }
  return t;
}
bool used[1 << 20];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  build(0, 0, n);
  for (int i = 0; i < n; i++) {
    int c = a[i];
    used[c] = true;
    int ci = i + 1;
    while (true) {
      int cur = 0;
      int r = getl(0, 0, n, i, c, cur);
      if (r == -1) {
        break;
      }
      c |= get(0, 0, n, i, r + 1);
      used[c] = true;
    }
  }
  int ans = 0;
  for (int i = 0; i < (1 << 20); i++) {
    if (used[i]) {
      ans++;
    }
  }
  cout << ans;
  return 0;
}
