#include using namespace std; #define rep(i,n) for(int i=0;i<(int)(n);i++) #define rrep(i,n) for(int i=(int)(n-1);i>=0;i--) #define ALL(v) v.begin(),v.end() #define RALL(v) v.rbegin(),v.rend() template using V=vector; template using VV=V>; using u128=__int128_t; using ll=long long; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); int n; cin>>n; V A(n); rep(i,n) cin>>A[i]; V L,R,C; for(int i=29;i>=0;i--){ int t=(1<>i)&1) continue; int r=-1; rep(j,n){ if(((A[j]>>i)&1)==0){ r=j; A[j]|=t; } } L.push_back(0); R.push_back(r); C.push_back(t); sort(ALL(A)); } int m=L.size(); cout<