#include <bits/stdc++.h>
using namespace std;
const int maxn = 1010000;
const int maxnum = 1048575;
int n;
int num[100010];
int que[23][100010];
int cnt[23];
bool was[maxnum + 10];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &num[i]);
  for (int i = 0; i < 22; i++) cnt[i] = 0;
  memset(was, 0, sizeof(was));
  for (int i = 0; i < n; i++) {
    int now = num[i];
    for (int j = 0; j < 22; j++) {
      if ((1 << j) & now) {
        que[j][cnt[j]] = i;
        cnt[j]++;
      }
    }
  }
  for (int j = 0; j < 22; j++) que[j][cnt[j]] = -1;
  for (int i = 0; i < n; i++) {
    int now = num[i];
    was[now] = 1;
    while (1) {
      int minfid = 1000100;
      for (int j = 0; j < 22; j++) {
        if ((1 << j) & now) continue;
        int *fid = lower_bound(que[j], que[j] + cnt[j], i);
        if ((*fid) == -1) continue;
        minfid = min(minfid, *fid);
      }
      if (minfid == 1000100) break;
      now = now | num[minfid];
      was[now] = 1;
    }
  }
  int ans = 0;
  for (int i = 0; i <= maxnum + 5; i++)
    if (was[i]) ans++;
  printf("%d\n", ans);
  return 0;
}
