#include <bits/stdc++.h>
using namespace std;
const int M = 25;
vector<int> idx[M];
const int N = (1 << 25) + 10;
bool vis[N];
void test_case() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    for (int j = 0; j < M; j++) {
      if (a[i] & (1 << j)) idx[j].push_back(i);
    }
  }
  for (int i = 0; i < M; i++) idx[i].push_back(n);
  if (count(a, a + n, 0)) vis[0] = 1;
  vector<int> v;
  for (int i = 0; i < n; i++) {
    int res = 0;
    int ii = i;
    while (true) {
      int mn = n;
      for (int j = 0; j < M; j++) {
        if (res & (1 << j)) continue;
        int pos =
            lower_bound(idx[j].begin(), idx[j].end(), ii) - idx[j].begin();
        mn = min(mn, idx[j][pos]);
      }
      if (mn == n) break;
      res |= a[mn];
      vis[res] = 1;
      ii = mn;
    }
  }
  cout << count(vis, vis + N, 1) << "\n";
}
int main() {
  cin.tie(0);
  cin.sync_with_stdio(0);
  int t = 1;
  while (t--) {
    test_case();
  }
}
