#include <bits/stdc++.h>
using namespace std;
int a[100005];
int nextBit[100005][20];
bool seen[1 << 20];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  memset(nextBit[0], -1, sizeof nextBit[0]);
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < 20; j++) {
      nextBit[i][j] = nextBit[i - 1][j];
      if ((a[i - 1] >> j) & 1) {
        nextBit[i][j] = i - 1;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    int val = a[i];
    int actual = i;
    while (true) {
      seen[val] = true;
      int last = -1;
      for (int j = 0; j < 20; j++) {
        if ((val & (1 << j)) == 0) last = max(last, nextBit[actual][j]);
      }
      if (last == -1) break;
      actual = last;
      val |= a[actual];
    }
  }
  printf("%d\n", (int)count(seen, seen + (1 << 20), true));
  return 0;
}
