#include <bits/stdc++.h>
using namespace std;
int values[2000005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  set<int> s;
  int n;
  cin >> n;
  int res = 0;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (values[x] == 0) res++;
    values[x] = 1;
    vector<int> v;
    v.push_back(x);
    for (int y : s) {
      int r = y | x;
      if (values[r] == 0) res++;
      values[r] = 1;
      v.push_back(r);
    }
    s.clear();
    for (int u : v) s.insert(u);
  }
  cout << res << endl;
  return 0;
}
