#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
const int mod = 1e9 + 7;
void solve() {
  int n;
  cin >> n;
  vector<bool> vis(2000000);
  vector<int> a;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    a.push_back(x);
    for (int j = 0; j < a.size(); j++) {
      a[j] |= x;
      vis[a[j]] = 1;
    }
    for (int j = 0; j < a.size() - 1; j++) {
      while (j < a.size() - 1 && a[j] == a[j + 1]) a.erase(a.begin() + j);
    }
  }
  int ans = 0;
  for (int i = 0; i < 2000000; i++) {
    if (vis[i]) ans++;
  }
  cout << ans << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) solve();
  return 0;
}
