N = int(input()) A = list(map(int, input().split())) if max(A) == min(A): if sum(A) // (N - 1) == 4: print(N, 0) else: print(0, N) else: print(A.count(min(A)), A.count(max(A)))