#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  int arr[n];
  for (long long i = 0; i < (n); ++i) cin >> arr[i];
  set<int> ans, prevSet;
  ans.insert(arr[0]);
  prevSet.insert(arr[0]);
  for (long long i = (1); i < (n); ++i) {
    ans.insert(arr[i]);
    set<int> tempSet;
    tempSet.insert(arr[i]);
    for (auto it = prevSet.begin(); it != prevSet.end(); ++it) {
      tempSet.insert(*it | arr[i]);
      ans.insert(*it | arr[i]);
    }
    prevSet = tempSet;
  }
  cout << ans.size() << '\n';
  return 0;
}
