#include <bits/stdc++.h>
using namespace std;
int n, a[100010];
bool f[1 << 20];
int b[20][100010], lb[20];
int q[20], lq;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    for (int j = 0; j < 20; j++)
      if (a[i] & (1 << j)) b[j][lb[j]++] = i;
    if (a[i] == 0) f[0] = true;
  }
  for (int i = 0; i < n; i++) {
    lq = 0;
    for (int j = 0; j < 20; j++) {
      int x = lower_bound(b[j], b[j] + lb[j], i) - b[j];
      if (x != lb[j]) q[lq++] = b[j][x];
    }
    sort(q, q + lq);
    lq = unique(q, q + lq) - q;
    int now = 0;
    for (int j = 0; j < lq; j++) {
      now |= a[q[j]];
      f[now] = true;
    }
  }
  int res = 0;
  for (int i = 0; i < (1 << 20); i++)
    if (f[i]) res++;
  printf("%d\n", res);
  return 0;
}
