#include <bits/stdc++.h>
using namespace std;
set<int> ans;
set<int> vals;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    int x;
    scanf("%d", &x);
    set<int> temp;
    temp.insert(x);
    for (auto it = vals.begin(); it != vals.end(); ++it) temp.insert((*it) | x);
    vals = temp;
    for (auto it = vals.begin(); it != vals.end(); ++it) ans.insert(*it);
  }
  printf("%d\n", (int)ans.size());
}
