#include <bits/stdc++.h>
using namespace std;
const int N = (1 << 20), M = 1e6 + 10;
int a[M], mk[N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    for (int j = i - 1; j >= 1; --j) {
      if (a[j] != (a[j] | a[i]))
        mk[a[j] = a[j] | a[i]] = 1;
      else
        break;
    }
    mk[a[i]] = 1;
  }
  int mask = (1 << 20) - 1, ans = 0;
  for (int i = 0; i <= mask; ++i)
    if (mk[i]) ans++;
  printf("%d\n", ans);
}
