#include <bits/stdc++.h>
using namespace std;
vector<int> muda[100000];
int main(void) {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  int last1[21];
  memset(last1, -1, sizeof last1);
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j < 20; j++) muda[i].push_back(last1[j]);
    for (int j = 0; j < 20; j++)
      if ((v[i] >> j) & 1) last1[j] = i;
  }
  set<int> unique;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    sort(muda[i].begin(), muda[i].end());
    int x = v[i];
    unique.insert(x);
    for (int k = 0; k < muda[i].size(); k++) {
      if (muda[i][k] != -1) {
        x = x | v[muda[i][k]];
        unique.insert(x);
      }
    }
  }
  cout << unique.size() << endl;
  return 0;
}
