#include <bits/stdc++.h>
using namespace std;
int n;
vector<vector<int>> v;
vector<int> a;
map<int, int> mp;
int cnt = 0;
void procedure(int idx, int val) {
  mp[val] = 1;
  if (idx == n) return;
  int mini = n;
  for (int bit = 28; bit >= 0; bit--) {
    if (val & (1 << bit)) continue;
    int i = upper_bound(v[bit].begin(), v[bit].end(), idx) - v[bit].begin();
    if (i == (int)v[bit].size()) continue;
    mini = min(v[bit][i], mini);
  }
  if (mini < n and mini != idx) procedure(mini, a[mini] | val);
}
int main() {
  cin >> n;
  a = vector<int>(n, 0);
  v = vector<vector<int>>(32, vector<int>(1, -1));
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    int val = a[i];
    for (int bit = 28; bit >= 0; bit--) {
      if (val & (1 << bit)) v[bit].push_back(i);
    }
  }
  for (int i = 0; i < n; i++) {
    procedure(i, a[i]);
  }
  cout << (int)mp.size() << endl;
}
