#include <bits/stdc++.h>
using namespace std;
set<int> global;
set<int> temp;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int numb;
    cin >> numb;
    global.insert(numb);
    temp.insert(numb);
    set<int> newTemp;
    for (set<int>::iterator it = temp.begin(); it != temp.end(); ++it) {
      newTemp.insert((*it | numb));
      global.insert((*it | numb));
    }
    temp = newTemp;
  }
  cout << global.size();
  return 0;
}
