#include #include #include #include typedef int Moisture; typedef std::multiset Reactants; int moist(Reactants xs) { int ans = 0; while (not xs.empty()) { auto x = *xs.begin(); xs.erase(xs.begin()); auto itr = xs.find(-x); if (itr != xs.end()) { ans++; xs.erase(itr); } } return ans; } int wet(Reactants xs) { int ans = 0; while (not xs.empty()) { auto x = *xs.rbegin(); xs.erase(xs.find(x)); auto itr = xs.lower_bound(1 - x); if (itr != xs.end()) { ans++; xs.erase(itr); } } return ans; } int dry(const Reactants& xs) { Reactants ys; for (auto x : xs) { ys.insert(-x); } return wet(ys); } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); int n; std::cin >> n; Reactants xs; for (auto i = 0; i < 2 * n; i++) { Moisture x; std::cin >> x; xs.insert(x); } std::cout << dry(xs) << ' ' << wet(xs) << ' ' << moist(xs) << std::endl; }