#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-11;
const int inf = 0x7FFFFFFF;
template <class T>
inline void checkmin(T &a, T b) {
  if (b < a) a = b;
}
template <class T>
inline void checkmax(T &a, T b) {
  if (b > a) a = b;
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
template <class T>
void show(T a, int n) {
  for (int i = 0; i < n; ++i) cout << a[i] << ' ';
  cout << endl;
}
template <class T>
void show(T a, int r, int l) {
  for (int i = 0; i < r; ++i) show(a[i], l);
  cout << endl;
}
int a[100000 + 5];
int main() {
  int n;
  while (cin >> n) {
    for (int i = 1; i <= n; i++) cin >> a[i];
    vector<int> v;
    int pre[20] = {0};
    for (int i = 1; i <= n; i++) {
      bool vis[20] = {0};
      v.push_back(a[i]);
      for (int j = 0; j < 20; j++) {
        if (a[i] & (1 << j)) pre[j] = i;
      }
      int now = a[i];
      for (int j = 0; j < 20; j++) {
        int mx = 0;
        for (int k = 0; k < 20; k++) {
          if (mx < pre[k] && !vis[k]) mx = pre[k];
        }
        if (!mx) break;
        for (int k = 0; k < 20; k++)
          if (pre[k] == mx) {
            vis[k] = true;
            now |= 1 << k;
          }
        v.push_back(now);
      }
    }
    sort(v.begin(), v.end());
    v.erase(unique(v.begin(), v.end()), v.end());
    cout << v.size() << endl;
  }
  return 0;
}
