#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int a[N], d[N][25], vis[N * 10];
pair<int, int> t[N];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  memset(d, -1, sizeof(d));
  for (int i = n; i >= 1; i--) {
    for (int k = 0; k <= 20; k++) {
      if ((a[i] >> k) & 1)
        d[i][k] = i;
      else
        d[i][k] = d[i + 1][k];
    }
  }
  for (int i = 1; i <= n; i++) {
    int x = a[i];
    vis[x] = 1;
    for (int k = 0; k <= 20; k++) t[k] = pair<int, int>(d[i][k], k);
    sort(t, t + 1 + 20);
    int k = 0;
    while (k <= 20 && t[k].first == -1) k++;
    while (k <= 20) {
      while (k <= 20 && t[k].first == t[k + 1].first)
        x |= (1 << t[k].second), k++;
      x |= (1 << t[k].second);
      k++;
      vis[x] = 1;
    }
  }
  int ans = 0;
  for (int i = 0; i < N * 10; i++)
    if (vis[i]) ans++;
  cout << ans << endl;
  return 0;
}
