#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
const double PI = acos(-1.0);
const int INF = 1000000000;
const int MOD = 1000000009;
const int M = INF;
int stress(vector<int> a) {
  set<int> ans;
  for (int i = 0; i < a.size(); i++) {
    int cur = a[i];
    for (int j = i; j < a.size(); j++) {
      cur |= a[j];
      ans.insert(cur);
    }
  }
  return ans.size();
}
int main() {
  double TIME_START = clock();
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  set<int> ans;
  set<pair<int, int> > bits;
  int bit[28] = {
      0,
  };
  for (int i = 0; i < 28; i++) bit[i] = -1;
  for (int i = 0; i < n; i++) {
    int cur = a[i];
    ans.insert(cur);
    for (set<pair<int, int> >::reverse_iterator it = bits.rbegin();
         it != bits.rend(); ++it) {
      cur |= a[it->first];
      ans.insert(cur);
    }
    for (int j = 0; j <= 25; j++)
      if (a[i] & (1 << j)) {
        if (bit[j] != -1) bits.erase(bits.find(make_pair(bit[j], j)));
        bit[j] = i;
        bits.insert(make_pair(i, j));
      }
  }
  cout << ans.size();
  fprintf(stderr, "\n\n%.15lf\n\n",
          (double)(clock() - TIME_START) / CLOCKS_PER_SEC);
  return 0;
}
