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