#include // #include // using namespace atcoder; #include #include #include #define rep(i,n) for (int i = 0;i < (n); ++i) using namespace std; using ll = long long; using P = pair; #define chmax(x,y) x = max(x,y) using R=double; using ld = long double; int INF = 1e9; ll LINF = 1e18; int mod = 1000000007; int mod2 = 1; using graph = vector>; // using mint = modint1000000007; int main(){ int n;cin >> n; vector a(n); rep(i,n) cin >> a[i]; int ans = 0; rep(i,n){ if(a[i] == 0) continue; ans++; int x = 0; while(1LL<<(x+1) <= a[i]) x++; for(int j = i+1;j < n;j++){ if(a[j] & (1LL<