#include <bits/stdc++.h>
double pi = acos(-1);
using namespace std;
int data[1000010];
set<int> vals;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &data[i]);
    vals.insert(data[i]);
    if (data[i]) {
      int v = 0;
      for (int j = i - 1; j >= 0; j--) {
        v |= data[j];
        if (!(data[i] & ~v)) break;
        vals.insert(v | data[i]);
      }
    }
  }
  cout << vals.size() << endl;
  return 0;
}
