#include <bits/stdc++.h>
using namespace std;
map<int, bool> vis;
long long a[100000][32] = {0}, b[100000][32], c = 0, d, i, j, n, m[100000], k,
          a1;
int main() {
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> m[i];
    a1 = m[i];
    j = 0;
    while (a1 > 0) {
      a[i][j++] = a1 % 2;
      a1 = a1 / 2;
    }
  }
  for (i = 0; i < 32; i++) {
    c = -1;
    for (j = 0; j < n; j++) {
      if (a[j][i] == 1) c = j;
      b[j][i] = c;
    }
  }
  c = 0;
  for (i = 0; i < n; i++) {
    d = m[i];
    if (!vis[d]) c++, vis[d] = 1;
    for (j = 0; j < 32; j++) {
      d = m[i];
      for (int k = 0; k < 32; k++) {
        if (b[i][j] < b[i][k]) d = d | m[b[i][k]];
      }
      if (!vis[d]) vis[d] = 1, c++;
    }
  }
  cout << c << endl;
  return 0;
}
