#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
long long max(long long a, long long b) {
  if (a > b) {
    return a;
  } else {
    return b;
  }
}
long long min(long long a, long long b) {
  if (a < b) {
    return a;
  } else {
    return b;
  }
}
long long sz(vector<long long> v) {
  if (v.empty()) {
    return 0;
  } else {
    return v.size();
  }
}
long long sz(set<long long> v) {
  if (v.empty()) {
    return 0;
  } else {
    return v.size();
  }
}
long long sz(vector<pair<long long, long long> > v) {
  if (v.empty()) {
    return 0;
  } else {
    return v.size();
  }
}
long long power(long long b, long long e) {
  if (e == 0) return 1;
  if (e % 2)
    return ((b * power((b) * (b), (e - 1) / 2)));
  else
    return power((b) * (b), e / 2);
}
long long modpower(long long b, long long e, long long q) {
  long long MOD = q;
  if (e == 0) return 1;
  if (e % 2)
    return ((b % MOD) * modpower((b % MOD) * (b % MOD), (e - 1) / 2, q)) % MOD;
  else
    return modpower((b % MOD) * (b % MOD), e / 2, q) % MOD;
}
void dpv(vector<long long> v) {
  for (long long i = 0; i < v.size(); i++) {
    cout << v[i] << " ";
  }
  cout << '\n';
}
void dpv(vector<pair<long long, long long> > v) {
  for (long long i = 0; i < v.size(); i++) {
    cout << v[i].first << " " << v[i].second << '\n';
  }
}
void dpv(set<long long> v) {
  for (auto i : v) {
    cout << i << " ";
  }
  cout << '\n';
}
vector<vector<long long> > v(200005);
vector<long long> dad;
vector<long long> intime;
vector<long long> outtime;
vector<long long> depth;
vector<bool> vis;
long long timer = 0;
void treemoves(long long n) {
  dad.assign(n + 1, 1);
  intime.assign(n + 1, 0);
  outtime.assign(n + 1, 0);
  depth.assign(n + 1, 0);
  vis.assign(n + 1, false);
}
void dfs_calc(long long root) {
  vis[root] = true;
  intime[root] = timer++;
  for (auto i : v[root]) {
    if (!vis[i]) {
      depth[i] = depth[root] + 1;
      dad[i] = root;
      dfs_calc(i);
    }
  }
  outtime[root] = timer++;
}
void oblivious() {
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  set<long long> present, org;
  for (long long i = 0; i < n; i++) {
    set<long long> next;
    next.insert(a[i]);
    org.insert(a[i]);
    for (auto it = present.begin(); it != present.end(); it++) {
      long long x = (*it) | a[i];
      next.insert(x);
      org.insert(x);
    }
    present = next;
  }
  cout << sz(org) << '\n';
  return;
  long long z = n * (n + 1) / 2;
  if (z == sz(org)) {
    cout << "YES" << '\n';
  } else {
    cout << "NO" << '\n';
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    oblivious();
  }
  return 0;
}
