N = int(input()) A = list(map(int, input().split())) if len(set(A)) == 1: if sum(A) == (N-1)*2: print(0, N) else: print(N, 0) exit() x = list(set(A)) x.sort() print(A.count(x[1]), A.count(x[0]))