#include <bits/stdc++.h>
using namespace std;
long long a[100010], x[30][100010], ans;
int n;
int num[30];
map<long long, bool> vis;
map<long long, bool> pd[100010];
int main() {
  scanf("%d", &n);
  long long sumx = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &a[i]);
    sumx = sumx | a[i];
    if (!vis[sumx]) {
      vis[sumx] = true;
      ans++;
    }
  }
  for (int i = 2; i <= n; i++) {
    sumx = 0;
    for (int j = i; j <= n; j++) {
      sumx = sumx | a[j];
      if (pd[j][sumx]) break;
      if (!vis[sumx]) {
        ans++;
        vis[sumx] = true;
        pd[j][sumx] = true;
      }
      pd[j][sumx] = true;
    }
  }
  printf("%I64d\n", ans);
}
