#include <bits/stdc++.h>
using namespace std;
int x[1048577];
int t[100000];
int main() {
  int n, aux;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> t[i];
    x[t[i]] = 1;
    for (int j = i - 1; j >= 0; j--) {
      if (t[j] == (t[j] | t[i])) break;
      t[j] |= t[i];
      x[t[j]] = 1;
    }
  }
  int cont = 0;
  for (int i = 0; i < 1048577; i++) cont += x[i];
  cout << cont;
  return 0;
}
