#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a;
  scanf("%d", &n);
  set<int> s[2], ans;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a);
    int prev = i & 1, next = (i + 1) & 1;
    s[next].clear();
    s[next].insert(a);
    for (set<int>::iterator it = s[prev].begin(); it != s[prev].end(); it++) {
      s[next].insert(*it | a);
    }
    for (set<int>::iterator it = s[next].begin(); it != s[next].end(); it++) {
      ans.insert(*it);
    }
  }
  printf("%d\n", ans.size());
}
