#include <bits/stdc++.h>
using namespace std;
int n, vet[100001], way[100001][30];
int res[2000000];
int main() {
  scanf("%d", &n);
  memset(way, 0x3f, sizeof way);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &vet[i]);
  }
  for (int i = n - 1; i >= 0; --i) {
    int now = vet[i], j = 0;
    memcpy(way[i], way[i + 1], sizeof way[i]);
    while (now) {
      if (now & 1) way[i][j] = i;
      now >>= 1;
      ++j;
    }
  }
  for (int i = 0; i < n; ++i) {
    int now = vet[i];
    res[now] = 1;
    int j = i + 1;
    while (j < n) {
      int next = n;
      for (int k = 0; k < 22; ++k) {
        if (now >> k & 1) continue;
        next = min(next, way[j][k]);
      }
      j = next;
      if (j < n) {
        for (int k = 0; k < 22; ++k) {
          if (way[j][k] == j) now |= 1 << k;
        }
      }
      res[now] = 1;
      ++j;
    }
  }
  int r = 0;
  for (int i = 0; i < 2000000; ++i) r += res[i];
  printf("%d\n", r);
  return 0;
}
