#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 6;
int a[maxn], n;
set<int> s;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) {
    int x = a[i], y = 0;
    s.insert(x);
    for (int j = i + 1; j <= n; j++) {
      x |= a[j];
      y |= a[j];
      s.insert(x);
      if (x == y) break;
    }
  }
  printf("%d\n", s.size());
  return 0;
}
