#include <bits/stdc++.h>
using namespace std;
const int M = (1 << 20) + 1;
int a[4 * M];
bool b[M];
bool c[2][M];
int main() {
  int n, t;
  scanf("%d", &n);
  int st = 0, en = 0, now = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &t);
    int enn = en;
    while (st < enn) {
      int x = a[st++];
      c[now][x] = 0;
      x |= t;
      if (!c[now ^ 1][x]) {
        a[en++] = x;
        b[x] = 1;
        c[now ^ 1][x] = 1;
      }
    }
    if (!c[now ^ 1][t]) {
      a[en++] = t;
      b[t] = 1;
      c[now ^ 1][t] = 1;
    }
    now ^= 1;
  }
  int sum = 0;
  for (int i = 0; i <= M; i++) sum += b[i];
  printf("%d\n", sum);
  return 0;
}
