#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  int arr[n];
  map<int, int> cnt;
  set<int> mys;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  mys.insert(arr[0]);
  cnt[arr[0]] = 1;
  for (int i = 1; i < n; i++) {
    set<int> news;
    for (__typeof(mys.begin()) it(mys.begin()); it != mys.end(); it++) {
      news.insert(*it | arr[i]);
      cnt[*it | arr[i]] = 1;
    }
    news.insert(arr[i]);
    cnt[arr[i]] = 1;
    mys = news;
  }
  cout << cnt.size() << "\n";
  return 0;
}
