#include <bits/stdc++.h>
using namespace std;
const int day[] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int dx[] = {-1, 1, 0, 0, -1, -1, 1, 1},
          dy[] = {0, 0, -1, 1, -1, 1, -1, 1};
const int N = 100010;
int n, m, a[N], bt[N], ans[N * 30];
void Init() { m = 0; }
void GetData() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
}
void Or(int p, int v) {
  for (; p <= n; p += (p & -p)) bt[p] |= v;
}
int Ask(int p) {
  int res = 0;
  for (; p > 0; p -= (p & -p)) res |= bt[p];
  return res;
}
int BinSearch(int lo, int hi, int x) {
  int mid, res = -1;
  while (lo <= hi) {
    mid = (lo + hi) >> 1;
    if (Ask(mid) > x) {
      if (res == -1 || res > mid) res = mid;
      hi = mid - 1;
    } else
      lo = mid + 1;
  }
  if (res == -1) return -1;
  return Ask(res);
}
void Solve() {
  int i, cur;
  Or(n, a[n]);
  ans[m++] = a[n];
  for (i = n - 1; i >= 1; --i) {
    cur = a[i];
    Or(i, a[i]);
    ans[m++] = a[i];
    for (;;) {
      cur = BinSearch(i + 1, n, cur);
      if (cur == -1) break;
      ans[m++] = cur;
    }
  }
  sort(ans, ans + m);
  m = unique(ans, ans + m) - ans;
  printf("%d\n", m);
}
int main() {
  Init();
  GetData();
  Solve();
  return 0;
}
