#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  set<long long> ans;
  vector<long long> a(n);
  for (long long i = 0; i < n; ++i) {
    cin >> a[i];
  }
  for (long long i = 0; i < n; ++i) {
    long long mask = 0;
    for (long long j = i; j < min(n, i + 60); ++j) {
      mask |= a[j];
      ans.insert(mask);
    }
  }
  cout << ans.size();
  return 0;
}
