#include <bits/stdc++.h>
using namespace std;
int arr[100009];
bool visited_ors[20000009];
deque<int> bit_indices[24];
void pre(int n) {
  for (int i = 0; i < n; i++) {
    int temp = arr[i];
    int counter = 0;
    while (temp) {
      if (temp % 2) bit_indices[counter].push_back(i);
      counter++;
      temp /= 2;
    }
  }
}
int main() {
  int n;
  cin >> n;
  int maxm = -1;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    maxm = max(maxm, arr[i]);
  }
  pre(n);
  int ans = 0;
  bool off_bits[24] = {};
  for (int start_index = 0; start_index < n; start_index++) {
    int current_or = arr[start_index];
    if (!visited_ors[current_or]) {
      ans++;
      visited_ors[current_or] = true;
    }
    for (int i = 0; i < 24; i++) {
      off_bits[i] = true;
    }
    int temp = arr[start_index];
    int counter = 0;
    while (temp) {
      if (temp % 2) {
        off_bits[counter] = false;
        bit_indices[counter].pop_front();
      }
      counter++;
      temp /= 2;
    }
    while (true) {
      int min_index = INT_MAX;
      for (int i = 0; i < 24; i++) {
        if (off_bits[i] && bit_indices[i].size()) {
          min_index = min(min_index, bit_indices[i].front());
        }
      }
      if (min_index == INT_MAX) break;
      for (int i = 0; i < 24; i++) {
        if (off_bits[i] && bit_indices[i].size() &&
            (min_index == bit_indices[i].front())) {
          off_bits[i] = false;
          current_or |= (1 << i);
        }
      }
      if (!visited_ors[current_or]) {
        ans++;
        visited_ors[current_or] = true;
      }
    }
  }
  cout << ans << endl;
}
