#include <bits/stdc++.h>
using namespace std;
int a, f[100005], fg[1 << 20], n, cnt = 0;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a);
    for (int j = i - 1; j >= 1; j--)
      if (f[j] != (f[j] | a))
        fg[f[j] = f[j] | a] = 1;
      else
        break;
    fg[f[i] = a] = 1;
  }
  for (int i = 0; i < (1 << 20); i++)
    if (fg[i]) cnt++;
  printf("%d\n", cnt);
}
