#include <bits/stdc++.h>
using namespace std;
int a[100000];
bool b[1048576];
int lastOne[20];
int segm_tree[400001];
void recalculate(int node) {
  segm_tree[node] = segm_tree[2 * node + 1] | segm_tree[2 * node + 2];
}
void update(int node, int left, int right, int x, int y) {
  if (left == right) {
    segm_tree[node] = y;
  } else {
    int middle = (left + right) / 2;
    if (x <= middle) {
      update(2 * node + 1, left, middle, x, y);
    } else {
      update(2 * node + 2, middle + 1, right, x, y);
    }
    recalculate(node);
  }
}
int query(int node, int left, int right, int x, int y) {
  if (x <= left && right <= y) {
    return segm_tree[node];
  } else {
    int answer = 0;
    int middle = (left + right) / 2;
    if (x <= middle) {
      answer = answer | query(2 * node + 1, left, middle, x, y);
    }
    if (y >= middle + 1) {
      answer = answer | query(2 * node + 2, middle + 1, right, x, y);
    }
    return answer;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  for (int i = 0; i < 20; ++i) lastOne[i] = -1;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    b[a[i]] = true;
    update(0, 0, n - 1, i, a[i]);
    for (int j = 0; j < 20; ++j) {
      if (lastOne[j] != -1) {
        b[query(0, 0, n - 1, lastOne[j], i)] = true;
      }
    }
    for (int j = 0; j < 20; ++j) {
      if (a[i] & (1 << j)) {
        lastOne[j] = i;
      }
    }
  }
  int sol = 0;
  for (int i = 0; i <= 1048575; ++i) {
    if (b[i]) sol++;
  }
  cout << sol;
  return 0;
}
