#include <bits/stdc++.h>
using namespace std;
vector<int> v[22];
int n, a[111111];
bool used[3333333];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
    for (int j = 0; j < 20; ++j)
      if (a[i] & (1 << j)) v[j].push_back(i);
  }
  for (int i = 0; i < n; ++i) {
    int x = a[i], k = i;
    while (k >= 0) {
      used[x] = true;
      int p = -1;
      for (int j = 0; j < 20; ++j)
        if (!(x & (1 << j))) {
          int l = lower_bound(v[j].begin(), v[j].end(), k) - v[j].begin() - 1;
          if (l >= 0) {
            p = max(p, v[j][l]);
          }
        }
      if (p >= 0) x |= a[p];
      k = p;
    }
  }
  int res = 0;
  for (int i = 0; i < 3000000; ++i) {
    res += used[i];
  }
  cout << res << endl;
  return 0;
}
