#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long arr[n];
  for (long long i = 0; i < n; i++) {
    cin >> arr[i];
  }
  set<long long> ans;
  set<long long> last;
  for (long long i = 0; i < n; i++) {
    set<long long> tem;
    ans.insert(arr[i]);
    tem.insert(arr[i]);
    for (auto now : last) {
      tem.insert(arr[i] | now);
      ans.insert(arr[i] | now);
    }
    last.clear();
    last = tem;
  }
  cout << ans.size() << endl;
  return 0;
}
