#include <bits/stdc++.h>
int k, a[1000005];
std::map<long long, int> b;
int main() {
  std::cin >> k;
  int cnt = 0;
  for (int i = 1; i <= k; i++) {
    std::cin >> a[i];
    if (!b[a[i]]) {
      cnt += 1;
      b[a[i]] = 1;
    }
  }
  for (int i = 1; i <= k; i++) {
    for (int j = i - 1; j >= 1; j--) {
      if (a[j] == (a[j] | a[i])) {
        break;
      }
      a[j] |= a[i];
      if (!b[a[j]]) {
        cnt += 1;
        b[a[j]] = 1;
      }
    }
  }
  std::cout << cnt << std::endl;
  return 0;
}
