#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans;
  cin >> n;
  unordered_set<int> s, m;
  vector<int> a, v;
  int temp;
  for (int i = 0; i < n; i++) {
    cin >> temp;
    a.push_back(temp);
  }
  for (int i = 0; i < n; i++) {
    v.push_back(a[i]);
    for (int x : s) {
      v.push_back(x | a[i]);
    }
    s.clear();
    for (int x : v) {
      s.insert(x);
      m.insert(x);
    }
    v.clear();
  }
  cout << m.size();
}
