#include <bits/stdc++.h>
using namespace std;
set<int> ms;
set<int> ms2;
set<int>::iterator it;
set<int> ans;
int arr[1000000];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  for (int i = 0; i < n; i++) {
    ms.insert(arr[i]);
    ms2.clear();
    for (it = ms.begin(); it != ms.end(); it++) {
      ms2.insert((*it) | arr[i]);
    }
    ms.clear();
    for (it = ms2.begin(); it != ms2.end(); it++) {
      ms.insert((*it) | arr[i]);
      ans.insert(*it | arr[i]);
    }
  }
  cout << ans.size();
  return 0;
}
