#include using namespace std; int maine(vector& A) { int book = 0; int l = 0, r = A.size() - 1; while (l < r) { if (A[l] + A[r] < 0) { book++; l++; r--; } else r--; } return book; } int main() { int N; cin >> N; vector A(N * 2); for (int i = 0; i < N * 2; i++) { cin >> A[i]; } int dry, wet, moist; sort(A.begin(), A.end()); dry = maine(A); reverse(A.begin(), A.end()); for (auto& x : A) x *= -1; wet = maine(A); int cnt[1000010] = {}; for (auto& x : A) { cnt[x + 100000]++; } moist = 0; for (int i = 1; i <= 100000; i++) { moist += min(cnt[100000 + i], cnt[100000 - i]); } moist += cnt[100000] / 2; cout << dry << " " << wet << " " << moist << endl; }