#include <bits/stdc++.h>
using namespace std;
void gk() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  std::cout.tie(0);
}
int64_t mul(int64_t a, int64_t b) { return (a * b) % (int64_t)1000000007; }
int64_t gcd(int64_t a, int64_t b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
const int64_t sz = 2502;
const int64_t sz2 = 2e6 + 5;
int64_t row[4] = {1, -1, 0, 0};
int64_t col[4] = {0, 0, -1, 1};
int64_t val[sz];
int64_t n;
void find() {
  int64_t n;
  cin >> n;
  vector<int64_t> ar(n);
  unordered_set<int64_t> ans;
  unordered_set<int64_t> curr;
  for (int64_t i = 0; i < n; i++) {
    cin >> ar[i];
  }
  ans.insert(ar[0]);
  curr.insert(ar[0]);
  for (int64_t i = 1; i < n; i++) {
    unordered_set<int64_t> aux;
    for (int64_t j : curr) {
      aux.insert(j | ar[i]);
    }
    aux.insert(ar[i]);
    curr = aux;
    for (int64_t i : curr) {
      ans.insert(i);
    }
  }
  cout << ans.size();
}
int32_t main() {
  int64_t t = 1;
  while (t--) {
    find();
  }
  return 0;
}
