n = int(input()) sq = [int(i) for i in input().split()] t = max(sq) k = min(sq) print(sq.count(t), sq.count(k))