#include <bits/stdc++.h>
int mark[1100000];
int a[1100000], b[1100000][2], cnt;
int main() {
  int n, i, j, t, cc, flag = 0, ans, max;
  while (~scanf("%d", &n)) {
    memset(mark, -1, sizeof(mark));
    cnt = max = 0;
    for (i = 0; i < n; i++) scanf("%d", &a[i]);
    for (i = 0; i < n; i++, flag ^= 1) {
      cc = 0;
      mark[a[i]] = i;
      b[cc++][flag] = a[i];
      if (a[i] > max) max = a[i];
      for (j = 0; j < cnt; j++) {
        t = a[i] | b[j][flag ^ 1];
        if (mark[t] != i) {
          mark[t] = i;
          b[cc++][flag] = t;
          if (t > max) max = t;
        }
      }
      cnt = cc;
    }
    for (i = ans = 0; i <= max; i++)
      if (mark[i] != -1) ans++;
    printf("%d\n", ans);
  }
}
