#include <bits/stdc++.h>
const int MOD = 1e9 + 7;
const int N = 1e5 + 15;
const int INF = (1 << 30) - 1;
const int letter = 130;
using namespace std;
int a[N], n;
set<int> s;
void in(int &x) {
  char c;
  while (c = getchar())
    if (c <= '9' && c >= '0') {
      break;
    }
  x = c - '0';
  while (c = getchar())
    if (c < '0' || c > '9') {
      break;
    } else {
      x = x * 10 + c - '0';
    }
}
int main() {
  while (scanf("%d", &n) != EOF) {
    s.clear();
    for (int i = 0; i < n; i++) in(a[i]);
    for (int i = 0; i < n; i++) {
      int vs = a[i];
      s.insert(vs);
      for (int j = 0; j < 20; j++) {
        if (a[i] & (1 << j)) {
          for (int k = i - 1; k >= 0; k--) {
            if (a[k] & (1 << j)) break;
            vs |= a[k];
            s.insert(vs);
          }
        }
      }
    }
    cout << s.size() << endl;
  }
  return 0;
}
