#include <bits/stdc++.h>
using namespace std;
bool chmin(int64_t& a, const int64_t& b) { return b < a ? a = b, 1 : 0; }
bool chmax(int64_t& a, const int64_t& b) { return a < b ? a = b, 1 : 0; }
constexpr int pct(int x) { return __builtin_popcount(x); }
constexpr int bits(int x) { return 31 - __builtin_clz(x); }
const int N = 1e6 + 1;
int64_t binpow(int64_t a, int64_t b, int64_t m) {
  a %= m;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % m;
    a = a * a % m;
    b >>= 1;
  }
  return res;
}
void run_case() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  set<int> second, ans, prev;
  for (int i = 0; i < n; i++) {
    second.insert(a[i]);
    for (auto it : prev) {
      second.insert(a[i] | it);
    }
    prev.clear();
    for (auto it : second) {
      prev.insert(it);
      ans.insert(it);
    }
    second.clear();
  }
  cout << ans.size();
}
auto clk = clock();
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  t = 1;
  while (t--) {
    run_case();
  }
  return 0;
}
