#include <bits/stdc++.h>
using namespace std;
const int MAX = numeric_limits<int>::max();
const int MIN = numeric_limits<int>::min();
bool vis[(1 << 20)];
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    for (int j = i - 1; j >= 0; j--) {
      if ((arr[j] | arr[i]) == arr[j]) {
        break;
      }
      arr[j] |= arr[i];
      vis[arr[j]] = 1;
    }
    vis[arr[i]] = 1;
  }
  long long int ans = 0;
  for (int i = 0; i < (1 << 20); i++) {
    if (vis[i]) ans++;
  }
  cout << ans;
}
