#include <bits/stdc++.h>
using namespace std;
set<int> ans, s1, s2;
int arr[100050];
int main() {
  int n, x, c = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &arr[i]);
  }
  for (int i = 0; i < n; i++) {
    s2.clear();
    s2.insert(arr[i]);
    for (set<int>::iterator it = s1.begin(); it != s1.end(); it++) {
      s2.insert(arr[i] | (*it));
    }
    s1 = s2;
    ans.insert(s2.begin(), s2.end());
  }
  printf("%d\n", (int)ans.size());
}
