#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
int n;
int a[200000];
bool f[2000000];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 0; i < (int)(n); i++) cin >> a[i];
  set<int> s[2];
  int cur = 0;
  for (int i = 0; i < (int)(n); i++) {
    s[1 - cur].clear();
    for (set<int>::iterator it = s[cur].begin(); it != s[cur].end(); it++) {
      int num = (*it) | a[i];
      f[num] = true;
      s[1 - cur].insert(num);
    }
    f[a[i]] = true;
    s[1 - cur].insert(a[i]);
    cur = 1 - cur;
  }
  int ans = 0;
  for (int i = 0; i < (int)(2000000); i++)
    if (f[i]) ++ans;
  cout << ans << endl;
  return 0;
}
