#include <bits/stdc++.h>
using namespace std;
int n, a[100005], x;
set<int> s;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    s.insert(a[i]);
    for (int j = i - 1; j >= 0; j--) {
      x = a[j] | a[i];
      if (x == a[j]) break;
      a[j] = x;
      s.insert(a[j]);
    }
  }
  cout << s.size();
}
