#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
const double PI = 3.1415926535897932384626433832795;
const double EPS = 1e-8;
const int inf = 1000000000;
const long long linf = 1000000000000000000LL;
template <class T>
inline T sqr(T x) {
  return x * x;
}
int gcd(int a, int b) { return a ? gcd(b % a, a) : b; }
int src[110000];
int n;
int main() {
  cin >> n;
  for (int i = 0; i < (n); ++i) {
    cin >> src[i];
  }
  vector<int> cur;
  set<int> res;
  cur.push_back(0);
  for (int i = 0; i < (n); ++i) {
    for (int j = 0; j < (((int)(cur).size())); ++j) {
      cur[j] |= src[i];
    }
    cur.push_back(src[i]);
    sort((cur).begin(), (cur).end());
    cur.erase(unique((cur).begin(), (cur).end()), cur.end());
    res.insert((cur).begin(), (cur).end());
  }
  cout << res.size();
  return 0;
}
