#include <bits/stdc++.h>
const int SZ = 1 << 20;
using namespace std;
int n, x;
bool vis[SZ];
vector<int> num;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &x);
    vis[x] = 1;
    for (int j = 0; j < (int)num.size(); j++) {
      num[j] |= x;
      vis[num[j]] = 1;
    }
    num.push_back(x);
    for (int j = 0; j < (int)num.size() - 1; j++)
      if (num[j] == num[j + 1]) num.erase(num.begin() + j), j--;
  }
  int res = 0;
  for (int i = 0; i < SZ; i++) res += vis[i];
  cout << res;
}
