#include <bits/stdc++.h>
using namespace std;
set<long long> s;
int main() {
  long long n;
  cin >> n;
  long long arr[n + 10];
  for (long long i = 0; i < n; i++) cin >> arr[i];
  for (long long i = 0; i < n; i++) {
    s.insert(arr[i]);
    for (int j = i - 1; j >= 0; j--) {
      long long keep = arr[i] | arr[j];
      if (keep == arr[j]) break;
      arr[j] = keep;
      s.insert(keep);
    }
  }
  cout << s.size() << endl;
}
