#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
long long n, a[100010], lst[26], ans = 0;
bool vis[30 * 100010];
vector<long long> v;
long long rint() {
  long long ret = 0, uu = 1;
  char c = getchar();
  while (!isdigit(c) && c != '-') c = getchar();
  if (c == '-') uu = -1, c = getchar();
  while (isdigit(c)) ret = ret * 10 + (c - '0'), c = getchar();
  return ret * uu;
}
int main() {
  long long i, j, st;
  n = rint();
  for (i = 0; i < n; i++) {
    a[i] = rint();
  }
  memset(lst, -1, sizeof(lst));
  for (i = 0; i < n; i++) {
    vis[a[i]] = true;
    if (a[i] == 0) {
      continue;
    }
    for (j = 0; j < 22; j++) {
      if (a[i] & (1 << j)) {
        lst[j] = i;
      }
    }
    st = a[i];
    v.clear();
    for (j = 0; j < 22; j++) {
      if (lst[j] != -1) {
        v.push_back(lst[j]);
      }
    }
    sort(v.begin(), v.end());
    for (j = v.size() - 1; j >= 0; j--) {
      st |= a[v[j]];
      vis[st] = true;
    }
  }
  for (i = 0; i <= (1 << 20); i++) {
    if (vis[i]) {
      ans++;
    }
  }
  printf("%I64d\n", ans);
  return 0;
}
