#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int a[N];
vector<int> pos[22];
struct node {
  int x, y;
  node() {}
  node(int a, int b) {
    x = a;
    y = b;
  }
  bool operator<(const node &b) const { return x < b.x; }
};
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    set<int> res;
    for (int i = 0; i < 22; i++) pos[i].clear();
    for (int i = 0; i < n; i++) {
      scanf("%d", &a[i]);
      res.insert(a[i]);
      for (int j = 0; j < 20; j++) {
        if (a[i] & (1 << j)) pos[j].push_back(i);
      }
    }
    for (int i = 0; i < 20; i++) sort(pos[i].begin(), pos[i].end());
    for (int i = 0; i < n; i++) {
      vector<node> tmp;
      for (int j = 0; j < 20; j++) {
        if (a[i] & (1 << j))
          continue;
        else {
          int ind =
              lower_bound(pos[j].begin(), pos[j].end(), i + 1) - pos[j].begin();
          if (ind < (int)pos[j].size() && ind >= 0)
            tmp.push_back(node(pos[j][ind], j));
        }
      }
      sort(tmp.begin(), tmp.end());
      int valu = a[i];
      for (int j = 0; j < (int)tmp.size(); j++) {
        valu |= a[tmp[j].x];
        res.insert(valu);
      }
    }
    cout << res.size() << endl;
  }
  return 0;
}
