#include <bits/stdc++.h>
using namespace std;
int a[100100], nex[21], check[1 << 20], b[100100][30];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < 20; i++) b[n][i] = n;
  for (int i = n - 1; i >= 0; i--) {
    cin >> a[i];
    for (int j = 0; j < 20; j++)
      if (a[i] & (1 << j))
        b[i][j] = i;
      else
        b[i][j] = b[i + 1][j];
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 20; j++) nex[j] = b[i][j];
    sort(nex, nex + 20);
    int x = a[i];
    check[x] = 1;
    for (int i : nex) {
      if (i == n) break;
      x |= a[i];
      check[x] = 1;
    }
  }
  ans = count(check, check + (1 << 20), 1);
  return cout << ans << endl, 0;
}
