#include <bits/stdc++.h>
using namespace std;
int sub[100010];
int main() {
  int N;
  set<int> S;
  while (~scanf("%d", &N)) {
    for (int i = 1; i <= N; i++) scanf("%d", &sub[i]);
    int k = 0;
    S.clear();
    for (int i = 1; i <= N; i++) {
      k |= sub[i];
      S.insert(k);
    }
    for (int i = 2; i <= N; i++) {
      k = sub[i - 1];
      int x = 0;
      for (int j = i; j <= N; j++) {
        x |= sub[j];
        S.insert(x);
        if ((k & x) == k) break;
      }
    }
    printf("%d\n", S.size());
  }
  return 0;
}
