#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  ;
  vector<int> a(n);
  for (int i = 0; i < n; scanf("%d", &a[i++]))
    ;
  vector<vector<int> > acc(32, vector<int>(n, 0));
  for (int i = 0; i < 32; i++) {
    for (int j = 0; j < n; j++) {
      acc[i][j] = bool(a[j] & (1 << i));
      if (j) acc[i][j] += acc[i][j - 1];
    }
  }
  set<int> res;
  for (int i = 0; i < n; i++) {
    int tmp = a[i];
    res.insert(tmp);
    vector<int> inds;
    for (int j = 0; j < 32; j++) {
      if (!(tmp & (1 << j))) {
        inds.push_back(upper_bound(acc[j].begin(), acc[j].end(), acc[j][i]) -
                       acc[j].begin());
      }
    }
    sort(inds.begin(), inds.end());
    inds.erase(unique(inds.begin(), inds.end()), inds.end());
    for (int j = 0; j < inds.size(); j++) {
      if (inds[j] == n) break;
      tmp |= a[inds[j]];
      res.insert(tmp);
    }
  }
  cout << res.size() << endl;
  return 0;
}
