#include <bits/stdc++.h>
using namespace std;
int rightIndex[100010][20];
int A[100010];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", A + i);
  for (int i = 0; i < 20; ++i)
    rightIndex[n - 1][i] = (A[n - 1] & (1 << i)) ? n - 1 : -1;
  for (int i = n - 2; i >= 0; --i)
    for (int j = 0; j < 20; ++j)
      rightIndex[i][j] = (A[i] & (1 << j)) ? i : rightIndex[i + 1][j];
  set<int> st;
  for (int i = 0; i < n; ++i) {
    set<int> idx;
    for (int j = 0; j < 20; ++j)
      if (rightIndex[i][j] != -1) idx.insert(rightIndex[i][j]);
    int res = A[i];
    st.insert(A[i]);
    for (set<int>::iterator it = idx.begin(); it != idx.end(); ++it) {
      res |= A[*it];
      st.insert(res);
    }
  }
  cout << st.size();
}
