#include <bits/stdc++.h>
using namespace std;
set<int> ans, temp1;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    set<int> temp2;
    temp2.insert(x);
    for (set<int>::iterator it = temp1.begin(); it != temp1.end(); it++) {
      temp2.insert((*it) | x);
    }
    for (set<int>::iterator it = temp2.begin(); it != temp2.end(); it++) {
      ans.insert(*it);
    }
    temp1 = temp2;
  }
  cout << ans.size() << endl;
  return 0;
}
