#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define INF (1<<29) #define rep(i,n) for(int i=0;i<(int)(n);i++) #define all(v) v.begin(),v.end() #define uniq(v) v.erase(unique(all(v)),v.end()) #define indexOf(v,x) (find(all(v),x)-v.begin()) int n,a[200000]; bool used[200000]; int Dry(){ set ,greater > > s; set ,greater > >::iterator it; sort(a,a+2*n,greater()); rep(i,2*n)s.insert(make_pair(a[i],i)); int res=0; memset(used,false,sizeof(used)); rep(i,2*n){ if(used[i])continue; s.erase(make_pair(a[i],i)); it=s.upper_bound(make_pair(-a[i],0)); if(it!=s.end()){ res++; used[it->second]=true; s.erase(it); } } return res; } int Wet(){ set > s; set >::iterator it; sort(a,a+2*n); rep(i,2*n)s.insert(make_pair(a[i],i)); int res=0; memset(used,false,sizeof(used)); rep(i,2*n){ if(used[i])continue; s.erase(make_pair(a[i],i)); it=s.upper_bound(make_pair(-a[i],INF)); if(it!=s.end()){ res++; used[it->second]=true; s.erase(it); } } return res; } int Moist(){ set > s; set >::iterator it; rep(i,2*n)s.insert(make_pair(a[i],i)); int res=0; memset(used,false,sizeof(used)); rep(i,2*n){ if(used[i])continue; s.erase(make_pair(a[i],i)); it=s.upper_bound(make_pair(-a[i],-1)); if(it!=s.end()&&it->first==-a[i]){ res++; used[it->second]=true; s.erase(it); } } return res; } int main(){ cin>>n; rep(i,2*n)cin>>a[i]; cout<