#include <bits/stdc++.h>
using namespace std;
bool exists[2000007];
int A[100007];
set<int> S[2];
int main() {
  int i, j, k, l, m = 0, n;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &A[i]);
  l = 0;
  set<int>::iterator it;
  for (i = 0; i < n; i++) {
    S[l].clear();
    for (it = S[1 - l].begin(); it != S[1 - l].end(); it++) {
      S[l].insert((*it) | A[i]);
      exists[(*it) | A[i]] = true;
    }
    S[l].insert(A[i]);
    exists[A[i]] = true;
    l = 1 - l;
  }
  for (i = 0; i <= 2000000; i++)
    if (exists[i]) m++;
  printf("%d\n", m);
  return 0;
}
