#include <bits/stdc++.h>
using namespace std;
int n, a[1 << 21], p[21], x, ans = 0;
bool b[1 << 21];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    b[a[i]] = 1;
    for (int j = 0; j <= 20; j++) {
      if (a[i] & 1 << j) {
        for (int k = i; k > p[j]; k--) x |= a[k], b[x] = 1;
        p[j] = i, x = 0;
      }
    }
  }
  for (int i = 0; i <= 1 << 20; i++) ans += b[i];
  printf("%d\n", ans);
  return 0;
}
