ll@n,a[2n],b=0,z=-1; rep(i,2n){ ll@r; a[i]=2r-i%2; } sortA(2n,a); rep(i,2n){ if(a[i]&1){ ++b; }else{ if(b){ --b; }else{ ++z; } } } wt(z);