#include <bits/stdc++.h>
using namespace std;
int t, n, k, a[100010];
set<int> s;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 1; i <= n; i++) {
    int temp1 = a[i];
    s.insert(temp1);
    int temp2 = 0;
    for (int j = i + 1; j <= n; j++) {
      temp1 = temp1 | a[j];
      temp2 = temp2 | a[j];
      s.insert(temp1);
      if (temp1 == temp2) break;
    }
  }
  printf("%d", s.size());
  return 0;
}
