#include <bits/stdc++.h>
using namespace std;
void debug() {
  fflush(stdin);
  printf("Press any key to continue");
  getc(stdin);
  fflush(stdin);
}
int n;
set<int> a, b, total;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    b.clear();
    for (auto e : a) b.insert(e | x);
    b.insert(x);
    for (auto e : b) total.insert(e);
    a = b;
  }
  printf("%d\n", total.size());
  return 0;
}
