#include <bits/stdc++.h>
using namespace std;
const int INF = (1 << 30) - 1;
const long double EPS = 1e-9;
const long double PI = fabs(atan2(0.0, -1.0));
const int MAXN = 100005;
int n;
int a[MAXN];
void load() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
}
int nxt[30][MAXN];
int lst[30];
void solve() {
  memset(lst, -1, sizeof(lst));
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j < 22; j++) nxt[j][i] = lst[j];
    for (int j = 0; j < 22; j++)
      if ((((a[i]) & (1 << (j))) == 0 ? false : true)) lst[j] = i;
  }
  set<int> all;
  for (int i = 0; i < n; i++) {
    all.insert(a[i]);
    int val = a[i];
    for (int j = i; j < n;) {
      val |= a[j];
      all.insert(val);
      int jump = INF;
      for (int k = 0; k < 21; k++) {
        if (nxt[k][j] == -1) continue;
        if ((((val) & (1 << (k))) == 0 ? false : true)) continue;
        jump = min(jump, nxt[k][j]);
      }
      j = jump;
    }
  }
  printf("%d\n", all.size());
}
int main() {
  load();
  solve();
  return 0;
}
