#include <bits/stdc++.h>
using namespace std;
int const N = 1e5 + 20, MAX = 2e6 + 20;
int n, a[N], ans;
bool mark[MAX];
vector<int> vec[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    mark[a[i]] = 1;
    vec[i].push_back(a[i]);
  }
  for (int i = 1; i < n; i++) {
    int temp = a[i];
    for (auto x : vec[i - 1]) {
      if ((temp | x) != temp) {
        vec[i].push_back(x);
        temp |= x;
        mark[temp] = 1;
      }
    }
  }
  for (int i = 0; i < MAX; i++) ans += mark[i];
  cout << ans << '\n';
}
