#include <bits/stdc++.h>
using namespace std;
const long int mod = 1e9 + 7;
long int n, a[100005];
long int twoPow[22];
long int bitSet[22];
bool ans[10000007];
long int hsh[100005];
void solve() {
  scanf("%ld", &n);
  for (long int i = 1; i <= n; i++) scanf("%ld", &a[i]);
  twoPow[0] = 1;
  for (long int i = 1; i <= 20; i++) twoPow[i] = twoPow[i - 1] * 2;
  long int tot = 0;
  for (long int i = 1; i <= n; i++) {
    if (a[i] == 0) {
      if (!ans[0]) tot++;
      ans[0] = true;
      continue;
    }
    long int num = a[i];
    for (long int j = 20; j >= 0; j--) {
      if (num / twoPow[j] == 0) continue;
      num -= twoPow[j];
      bitSet[j] = i;
    }
    for (long int j = 0; j <= 20; j++) hsh[bitSet[j]] = 0;
    for (long int j = 0; j <= 20; j++)
      if (bitSet[j] != 0) hsh[bitSet[j]] += twoPow[j];
    set<long int> se;
    se.clear();
    vector<long int> vec(0);
    for (long int j = 0; j <= 20; j++)
      if (bitSet[j] != 0) se.insert(bitSet[j]);
    vec.assign(se.begin(), se.end());
    num = 0;
    for (long int j = vec.size() - 1; j >= 0; j--) {
      num += hsh[vec[j]];
      if (!ans[num]) tot++;
      ans[num] = true;
    }
  }
  printf("%ld", tot);
  return;
}
int main() {
  solve();
  return 0;
}
