#include #include #include #include #include #define REP(i, a, b) for (int i = int(a); i < int(b); i++) #ifdef _DEBUG_ #define dump(val) cerr << __LINE__ << ":\t" << #val << " = " << (val) << endl #else #define dump(val) #endif using namespace std; typedef long long int ll; template vector make_v(size_t a, T b) { return vector(a, b); } template auto make_v(size_t a, Ts... ts) { return vector(a, make_v(ts...)); } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin >> n; vector a, b; int zero = 0; REP(i, 0, 2 * n) { int v; cin >> v; if (v < 0) { a.push_back(-v); } else if (v > 0) { b.push_back(v); } else { zero++; } } sort(rbegin(a), rend(a)); sort(rbegin(b), rend(b)); auto Wet = [&]() -> int { int ans = 0; int j = 0; REP(i, 0, b.size()) { while (j < a.size() && b[i] <= a[j]) { j++; } if (j >= a.size()) { int rest = b.size() - i; int m = min(rest, zero); ans += m; rest -= m; ans += rest / 2; break; } ans++; j++; } return ans; }; auto Dry = [&]() -> int { swap(a, b); int res = Wet(); swap(a, b); return res; }; auto Moist = [&]() -> int { int res = zero / 2; map ma, mb; REP (i, 0, a.size()) { ma[a[i]]++; } REP (i, 0, b.size()) { mb[b[i]]++; } for (auto &it : ma) { res += min(it.second, mb[it.first]); } return res; }; cout << Dry() << " " << Wet() << " " << Moist() << endl; return 0; }