#include <bits/stdc++.h>
#pragma GCC optimize("O3")
const int inf = 0x3f3f3f3f;
const long long LL_INF = 0x3f3f3f3f3f3f3f3f;
template <typename T>
T gcd(T a, T b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long power(long long a, long long b, long long m = 1000000007) {
  long long answer = 1;
  while (b) {
    if (b & 1) answer = (answer * a) % m;
    b /= 2;
    a = (a * a) % m;
  }
  return answer;
}
using namespace std;
bool chk[1048576];
int main() {
  set<int> st;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    set<int>::iterator it;
    set<int> st2;
    for (it = st.begin(); it != st.end(); it++) {
      int y = *it;
      st2.insert(y | x);
    }
    st2.insert(x);
    st = st2;
    st2.clear();
    for (it = st.begin(); it != st.end(); it++) {
      chk[*it] = 1;
    }
  }
  int cnt = 0;
  for (int i = 0; i < 1048576; i++) {
    if (chk[i]) cnt++;
  }
  cout << cnt;
  return 0;
}
