#include <bits/stdc++.h>
using namespace std;
int n, a[111111], ans;
set<int> s;
bool ok[1150100];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%d ", &a[i]);
    ok[a[i]] = 1;
  }
  s.insert(a[0]);
  vector<int> w[111111];
  for (int i = 1; i < n; i++) {
    for (set<int>::iterator it = s.begin(); it != s.end(); it++) {
      ok[a[i] | (*it)] = 1;
      w[i].push_back(a[i] | (*it));
    }
    s.clear();
    for (size_t j = 0; j < w[i].size(); j++) s.insert(w[i][j]);
    s.insert(a[i]);
  }
  for (int i = 0; i < 1150000; i++)
    if (ok[i]) ans++;
  cout << ans;
  return 0;
}
