#include <bits/stdc++.h>
using namespace std;
set<int> d;
int a[111111];
int main() {
  int n;
  int disti;
  int ans = 0;
  int i, j;
  scanf("%d", &n);
  d.clear();
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    d.insert(a[i]);
    disti = a[i];
    for (j = i - 1; j >= 1; j--) {
      disti = disti | a[j];
      if (disti == a[j]) break;
      a[j] = disti;
      d.insert(disti);
    }
  }
  printf("%d\n", d.size());
}
