import math._ import scala.collection.mutable.ArrayBuffer object Main { def moist(positives: Array[Int], negatives: Array[Int]): Int = { val ar = Array.fill(100001)(0) for (x <- negatives) { ar(abs(x)) += 1 } var zero = 0 var ans = 0 for (x <- positives) { if (x == 0) { zero += 1 } else { if (ar(x) > 0) { ans += 1 ar(x) -= 1 } } } ans + zero / 2 } def wet(positives: Array[Int], negatives: Array[Int]): Int = { val xs = negatives ++ positives var ans = 0 var lo = 0 var hi = xs.length - 1 while (lo < hi) { if (xs(lo) + xs(hi) > 0) { ans += 1 lo += 1 hi -= 1 } else { lo += 1 } } ans } def dry(positives: Array[Int], negatives: Array[Int]): Int = { val xs = negatives ++ positives var ans = 0 var lo = 0 var hi = xs.length - 1 while (lo < hi) { if (xs(lo) + xs(hi) < 0) { ans += 1 lo += 1 hi -= 1 } else { hi -= 1 } } ans } def main(args: Array[String]) { val sc = new java.util.Scanner(System.in) val n = sc.nextInt val ps = new ArrayBuffer[Int] val ns = new ArrayBuffer[Int] for (i <- 1 to 2 * n) { val x = sc.nextInt if (x >= 0) ps.append(x) else ns.append(x) } val positives = ps.sorted.toArray val negatives = ns.sorted.toArray val d = dry(positives, negatives) val w = wet(positives, negatives) val m = moist(positives, negatives) println(s"$d $w $m") } }