#include <bits/stdc++.h>
using namespace std;
using namespace std;
int min3(int x, int y, int z) {
  int tmp = min(x, y);
  return min(tmp, z);
}
int max3(int x, int y, int z) {
  int tmp = max(x, y);
  return max(tmp, z);
}
int a[100005];
set<long long> ans;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  while (~scanf("%d", &n)) {
    memset(a, 0, sizeof(a));
    ans.clear();
    int tmp, b;
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      ans.insert(a[i]);
    }
    for (int i = 1; i <= n; i++) {
      b = tmp = a[i];
      for (int j = i + 1; j <= n; j++) {
        b -= b & a[j];
        if (b == 0) break;
        tmp = tmp | a[j];
        ans.insert(tmp);
      }
    }
    printf("%I64d\n", ans.size());
  }
}
