#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
const int inf = 0x7fffffff;
long long a[maxn];
set<long long> z;
int main() {
  int T, n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%I64d", &a[i]);
  long long ans, sum;
  for (int i = 0; i < n; i++) {
    ans = a[i];
    sum = 0;
    z.insert(a[i]);
    for (int j = i + 1; j < n; j++) {
      ans = ans | a[j];
      sum = sum | a[j];
      z.insert(ans);
      if (sum == ans) break;
    }
  }
  printf("%d\n", z.size());
  return 0;
}
