#include <bits/stdc++.h>
using namespace std;
int a[100001], b[100001][21];
int main() {
  int n, t;
  set<int> s;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  a[n] = 0;
  for (int k = 0; k < 21; k++) {
    t = 1 << k;
    for (int j = n, i = n - 1; i >= 0; i--) {
      if ((a[i] & t) != 0) {
        j = i;
      }
      b[i][k] = j;
    }
  }
  for (int i = 0; i < n; i++) {
    sort(b[i], b[i] + 21);
  }
  for (int i = 0; i < n; i++) {
    s.insert(a[i]);
    for (int k = 0; k < 21; k++) {
      a[i] = a[i] | a[b[i][k]];
      s.insert(a[i]);
    }
  }
  printf("%d\n", s.size());
  return 0;
}
