import sequtils,strutils,math var N = stdin.readline.parseInt A = stdin.readline.split.map(parseInt) m = max(A) if m == N * 2 - 2 and m == min(A): echo N, " ", 0 elif m == N * 4 - 4 and m == min(A): echo 0, " ", N else: var cnt : int for a in A: if a == m: cnt += 1 echo cnt, " ", N - cnt