#include <bits/stdc++.h>
using namespace std;
long long a[1 << 22], csum[1 << 22], b[1 << 22];
long long x = 1, m = x << 22;
int main() {
  long long i, j, k, l, z, c, t, sz, n;
  cin >> n;
  for (i = 0; i < n; i++) cin >> a[i];
  c = 0, b[a[0]] = 1, csum[0] = a[0];
  for (i = 1; i < n; i++) {
    csum[i] = csum[i - 1] | a[i];
    b[csum[i]] = 1, b[a[i]] = 1;
  }
  a[n] = 0;
  for (i = 1; i < n; i++) {
    k = a[i];
    for (j = i; j < n; j++) {
      if (k == csum[j]) break;
      csum[j] = k;
      b[k] = 1;
      k = k | a[j + 1];
    }
  }
  for (i = 0; i < m; i++) {
    c = c + b[i];
  }
  cout << c << endl;
}
