#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
const long long M = 1e9 + 7;
long long pwr(long long a, long long x) {
  long long r = 1;
  while (x > 0) {
    if (x & 1) r = r * a;
    a = a * a;
    x /= 2;
  }
  return r;
}
long long axm(long long a, long long x, long long m) {
  a %= m;
  long long r = 1;
  while (x > 0) {
    if (x & 1) r = r * a % m;
    a = a * a % m;
    x /= 2;
  }
  return r;
}
long long inv(long long a, long long m) { return axm(a, m - 2, m); }
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main(int argc, char **argv) {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  ;
  long long n;
  cin >> n;
  vector<long long> a(n + 1);
  vector<vector<long long>> b(n + 1, vector<long long>(21));
  for (long long i = 1; i < n + 1; i++) {
    cin >> a[i];
    for (long long j = 0; j < 21; j++) {
      if (a[i] & (1 << j))
        b[i][j] = i;
      else
        b[i][j] = b[i - 1][j];
    }
  }
  set<long long> s;
  for (long long i = n; i >= 1; i--) {
    long long t = a[i], x = i;
    s.insert(t);
    while (1) {
      long long p = 0;
      for (long long j = 0; j < 21; j++)
        if (!(t & (1 << j)) && b[i][j] > p) p = b[i][j];
      if (!p) break;
      t |= a[p];
      s.insert(t);
      x = p;
    }
  }
  cout << s.size() << "\n";
  return 0;
}
