#include #include using namespace std; using namespace atcoder; typedef long long ll; typedef long double ld; #define REP(i, n) for (int i = 0; i < (n); ++i) #define REPR(i, n) for (int i = n - 1; i >= 0; --i) #define FOR(i, m, n) for (int i = m; i < n; ++i) #define FORR(i, m, n) for (int i = m; i >= n; --i) #define ALL(v) (v).begin(),(v).end() #define ALLR(v) (v).rbegin(),(v).rend() #define fi first #define se second #define PB push_back #define EB emplace_back template using PQ = priority_queue; template using QP = priority_queue,greater>; templatevoid debug(const T &v,ll h,ll w){for(ll i=0;ivoid debug(const T &v,ll n){for(ll i=0;ivoid debug(const vector&v){debug(v,v.size());} templatevoid debug(const vector>&v){for(auto &vv:v)debug(vv,vv.size());} templatevoid debug(stack st){while(!st.empty()){cout<void debug(queue st){while(!st.empty()){cout<void debug(deque st){while(!st.empty()){cout<void debug(PQ st){while(!st.empty()){cout<void debug(QP st){while(!st.empty()){cout<void debug(const set&v){for(auto z:v)cout<void debug(const multiset&v){for(auto z:v)cout<void debug(const array &a){for(auto z:a)cout<void debug(const map&v){for(auto z:v)cout<<"["<bool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b &a){ multiset st; REP(i,a.size()) st.insert(a[i]); int ans=0; REP(i,a.size()){ if(a[i]<=0){ auto itr=st.upper_bound(-a[i]); if(itr==st.end()) continue; ans++; st.erase(st.find(*itr)); } } int cnt=0; for(auto itr=st.begin();itr!=st.end();itr++){ if(*itr>0) cnt++; } return ans+cnt/2; } int wet(vector &a){ vector b=a; REP(i,b.size()) b[i]=-a[i]; return dry(b); } int moist(vector &a){ vector s(100005),m(100005); int z=0; REP(i,a.size()){ if(a[i]>0) s[a[i]]++; else if(a[i]<0) m[-a[i]]++; else z++; } int ans=0; REP(i,100005) ans+=min(s[i],m[i]); ans+=z/2; return ans; } int main(){ cin.tie(0); ios::sync_with_stdio(false); int n;cin >> n; vector a(2*n); REP(i,2*n) cin >> a[i]; cout << wet(a) << " " << dry(a) << " " << moist(a) << endl; }