#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
const int N = 1e7 + 100;
const int INF = 1e9 + 100;
map<long long int, bool> m;
map<long long int, bool> mm;
bool ans[N];
long long int a[MAXN];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  long long int cnt = 1;
  for (long long int i = 0; i < n; i++) cin >> a[i];
  ans[a[0]] = true;
  m[a[0]] = true;
  for (long long int i = 1; i < n; i++) {
    mm = m;
    m.clear();
    if (!ans[a[i]]) cnt++;
    ans[a[i]] = true;
    m[a[i]] = true;
    for (auto j : mm) {
      if (!ans[j.first | a[i]]) cnt++;
      ans[j.first | a[i]] = true;
      m[j.first | a[i]] = true;
    }
  }
  cout << cnt;
}
