#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int L = 1 << 20;
bitset<L> ans;
int dat[N], nxt[N][25], last[25];
int n;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> dat[i];
  for (int i = 0; i < 25; i++) last[i] = n;
  for (int i = n - 1; i >= 0; i--) {
    for (int bit = 0; bit <= 20; bit++) {
      if ((dat[i] & (1LL << bit))) last[bit] = i;
      nxt[i][bit] = last[bit];
    }
  }
  for (int i = 0; i < n; i++) {
    int j = i, curr = 0;
    while (j < n) {
      curr |= dat[j];
      ans[curr] = 1;
      int nxtj = n;
      for (int bit = 0; bit <= 20; bit++)
        if ((curr & (1LL << bit)) == 0) nxtj = min(nxtj, nxt[j][bit]);
      j = nxtj;
    }
  }
  cout << ans.count() << "\n";
  return 0;
}
