#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  set<int> vals;
  set<int> cur;
  for (int i = 0; i < n; ++i) {
    {
      set<int> cur2;
      transform(cur.begin(), cur.end(), inserter(cur2, cur2.end()),
                [&a, i](int x) { return x | a[i]; });
      cur = cur2;
    }
    cur.insert(a[i]);
    copy(cur.begin(), cur.end(), inserter(vals, vals.begin()));
  }
  cout << vals.size() << '\n';
  return 0;
}
