#include <bits/stdc++.h>
using namespace std;
const int maxn = 100001;
int n, sum, ans, a[maxn];
bool st[1 << 20];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  a[0] = (1 << 20) - 1;
  for (int l = 0; l <= n; l++) {
    sum = 0;
    for (int i = l + 1; i <= n; i++) {
      sum |= a[i];
      st[sum] = 1;
      if ((sum & a[l]) == a[l]) break;
    }
  }
  for (int u = 0; u < (1 << 20); u++)
    if (st[u]) ans++;
  printf("%d\n", ans);
}
