#include <bits/stdc++.h>
using namespace std;
const int MAXPOW = 20;
const int MAXA = 1048577;
const int MAXN = 100009;
int n;
int k;
vector<int> a;
unordered_set<int> visited[MAXN];
bool used[MAXA];
void gen() {
  freopen("input.txt", "w", stdout);
  n = 100000;
  printf("%d\n", n);
  for (int i = 0; i < n; ++i) printf("%d ", rand() % 1000001);
  exit(0);
}
int stupid() {
  used[0] = true;
  for (int i = 0; i < n; ++i) {
    int x = 0;
    for (int j = i; j < n; ++j) {
      x |= a[j];
      if (!used[x]) {
        cerr << "i"
             << ": " << i << endl;
        ;
        cerr << "j"
             << ": " << j << endl;
        ;
        cerr << "x"
             << ": " << x << endl;
        ;
      }
      used[x] = true;
    }
  }
  int cnt = 0;
  for (int i = 0; i < MAXA; ++i)
    if (used[i]) cnt++;
  return cnt;
}
int main() {
  scanf("%d", &n);
  a.resize(n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
  for (int i = 0; i < n; ++i) {
    int x = 0;
    for (int j = i; j < n; ++j) {
      x |= a[j];
      if (visited[j].find(x) != visited[j].end()) break;
      visited[j].insert(x);
      used[x] = true;
    }
  }
  int cnt = 0;
  for (int i = 0; i < MAXA; ++i)
    if (used[i]) cnt++;
  printf("%d\n", cnt);
  return 0;
}
