#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
const int M = 21;
const int K = 3;
const int LIT = 2500;
const int INF = 1 << 30;
const double eps = 1e-10;
const int dir[][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
const int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int n, a[N];
long long res;
vector<int> loc[M];
bool vis[1 << M];
void init() {
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  res = 0;
  memset(vis, 0, sizeof(vis));
  for (int i = 0; i < n; i++) {
    for (int j = 0, x = a[i]; x; x >>= 1, j++) {
      if (x & 1) loc[j].push_back(i);
    }
  }
}
inline void valid(int &num) {
  if (!vis[num]) res++, vis[num] = true;
}
void solve() {
  int num;
  for (int i = 0; i < n; i++) {
    num = a[i];
    valid(num);
    while (1) {
      int m = n + 1;
      vector<int> p;
      for (int j = 0; j < 20; j++) {
        if ((1 << j) & num) continue;
        vector<int>::iterator it = upper_bound(loc[j].begin(), loc[j].end(), i);
        if (it != loc[j].end()) {
          if (*it < m) {
            p.clear();
            m = *it;
            p.push_back(j);
          } else if (*it == m) {
            p.push_back(j);
          }
        }
      }
      if (m == n + 1)
        break;
      else {
        for (int k = 0; k < p.size(); k++) num |= (1 << p[k]);
        valid(num);
      }
    }
  }
  cout << res << endl;
}
int main() {
  while (cin >> n) {
    init();
    solve();
  }
  return 0;
}
