#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
set<long long> s, temp;
map<long long, long long> mp;
int main() {
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    long long k;
    cin >> k;
    v.push_back(k);
  }
  for (long long i = 0; i < v.size(); i++) {
    s.insert(v[i]);
    for (long long j = i - 1; j >= 0; j--) {
      long long x = v[i] | v[j];
      if (x == v[j]) break;
      v[j] = x;
      s.insert(v[j]);
    }
  }
  cout << s.size() << endl;
}
