#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, i, a, t, l, b;
  unordered_set<int> glb, curr[2];
  unordered_set<int>::iterator iter;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a;
    for (iter = curr[i % 2].begin(); iter != curr[i % 2].end(); iter++) {
      b = (*iter) | a;
      curr[(i + 1) % 2].insert(b);
      glb.insert(b);
    }
    curr[i % 2].clear();
    glb.insert(a);
    curr[(i + 1) % 2].insert(a);
  }
  cout << glb.size();
  return 0;
}
