#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const int N = 100024;
int a[N];
int dp[N];
int n;
int main() {
  while (scanf("%d", &n) != EOF) {
    int ans = 0;
    (memset(dp, 0, sizeof(dp)));
    set<int> st;
    for (int i = 1; i < n + 1; ++i) {
      scanf("%d", &a[i]);
      st.insert(a[i]);
    }
    for (int i = 1; i < n + 1; ++i) {
      dp[i] = a[i];
      int cnt = a[i];
      for (int j = i + 1; j < n + 1; ++j) {
        cnt -= (cnt & a[j]);
        if (cnt == 0) break;
        dp[j] = dp[j - 1] | a[j];
        st.insert(dp[j]);
      }
    }
    printf("%d\n", st.size());
  }
  return 0;
}
