#include <bits/stdc++.h>
using namespace std;
int x;
int a[100005];
int dp[1048590];
int main() {
  int N;
  cin >> N;
  for (int n = 1; n <= N; ++n) {
    scanf("%d", &x);
    for (int m = n - 1; m >= 1; --m) {
      if (a[m] != (a[m] | x)) {
        dp[a[m] = a[m] | x] = 1;
      } else {
        break;
      }
    }
    dp[a[n] = x] = 1;
  }
  int Ans = 0;
  for (int i = 0; i < 1048579; ++i) {
    if (dp[i]) {
      Ans++;
    }
  }
  cout << Ans + 0 << endl;
  return 0;
}
