#include <bits/stdc++.h>
using namespace std;
using namespace std;
set<int> s;
set<int> s1;
set<int> s2;
int x, n;
int main() {
  scanf("%d", &n);
  for (int(i) = 0; (i) < (n); ++(i)) {
    scanf("%d", &x);
    for (set<int>::iterator it = s1.begin(); s1.end() != it; ++it)
      s2.insert(*it | x);
    s2.insert(x);
    for (set<int>::iterator it = s2.begin(); s2.end() != it; ++it)
      s.insert(*it);
    s1 = s2;
    s2.clear();
  }
  printf("%d", int((s).size()));
}
