#include <bits/stdc++.h>
using namespace std;
int a[100010];
int f[100010][21];
set<int> st;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  for (int i = 1; i <= n; i++)
    for (int j = 0; j <= 20; j++) {
      if (a[i] & (1 << j))
        f[i][j] = i;
      else
        f[i][j] = f[i - 1][j];
    }
  for (int i = 1; i <= n; i++) {
    st.insert(a[i]);
    vector<int> vt;
    for (int j = 0; j <= 20; j++) {
      if (f[i][j]) vt.push_back(f[i][j]);
    }
    sort(vt.begin(), vt.end());
    int s = a[i];
    for (int j = ((vt).size()); j > 0; j--) {
      s |= a[vt[j - 1]];
      st.insert(s);
    }
  }
  printf("%d\n", ((st).size()));
  return 0;
}
