#include <bits/stdc++.h>
using namespace std;
int main() {
  map<int, bool> mp, mp2, mp3, mp4;
  int n, a;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    for (map<int, bool>::const_iterator it = mp2.begin(); it != mp2.end();
         it++) {
      int r = a | (it->first);
      mp[r] = true;
      mp3[r] = true;
    }
    mp[a] = true;
    mp3[a] = true;
    mp2 = mp3, mp3 = mp4;
  }
  int c = 0;
  for (map<int, bool>::const_iterator it = mp.begin(); it != mp.end(); it++)
    c++;
  cout << c;
}
