#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  int a[n];
  set<int> s;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<int> v;
  for (int i = 0, st = 0, en = 0; i < n; i++, st = en, en = v.size()) {
    v.push_back(a[i]);
    for (int j = st; j < en; j++) {
      if (v.back() != (v[j] | a[i])) {
        v.push_back(v[j] | a[i]);
      }
    }
  }
  long long val = set<int>(begin(v), end(v)).size();
  cout << val << endl;
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ofstream out("output.txt");
  auto start = chrono::high_resolution_clock::now();
  long long t = 1;
  for (long long test = 1; test <= t; test++) {
    solve();
  }
  auto stop = chrono::high_resolution_clock::now();
}
