#include <bits/stdc++.h>
using namespace std;
bool psbl[2000100] = {0};
int a[100010];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  vector<int> tmp;
  for (int i = n; i > 0; i--) {
    vector<int> ntmp;
    ntmp.push_back(a[i]);
    psbl[a[i]] = 1;
    for (int j = 0; j < tmp.size(); j++) {
      ntmp.push_back(a[i] | tmp[j]);
      psbl[a[i] | tmp[j]] = 1;
    }
    set<int> s;
    for (int i = 0; i < ntmp.size(); i++) s.insert(ntmp[i]);
    ntmp.clear();
    for (set<int>::iterator it = s.begin(); it != s.end(); it++)
      ntmp.push_back(*it);
    tmp = ntmp;
  }
  int res = 0;
  for (int i = 0; i <= 2000000; i++) {
    res += psbl[i];
  }
  cout << res << endl;
}
