#define _USE_MATH_DEFINES #include using namespace std; signed main() { ios::sync_with_stdio(false); cin.tie(0); auto calc = [] (vector a, vector b, int zero) -> int { int res = 0; multiset st; for (auto& x : b) st.insert(x); for (int i = 0; i < zero; i++) a.push_back(0); sort(a.rbegin(), a.rend()); for (auto& x : a) { auto it = st.upper_bound(x); if (it == st.end()) continue; st.erase(it); res++; } return res + (int) st.size() / 2; }; int n; cin >> n; vector po, ne; vector cp(101010), cn(101010); int z = 0; for (int i = 0; i < n + n; i++) { int a; cin >> a; if (a > 0) { po.push_back(a); cp[a]++; } if (a < 0) { ne.push_back(-a); cn[-a]++; } if (a == 0) z++; } int dry = calc(po, ne, z); int wet = calc(ne, po, z); int moist = 0; for (int i = 0; i < 101010; i++) { moist += min(cp[i], cn[i]); } moist += z / 2; cout << dry << " " << wet << " " << moist << endl; return 0; }