N = int(input()) a = list(map(int,input().split())) b = max(a) c = min(a) if b == c: if b//2 == N-1: print("{} 0".format(N)) else: print("0 {}".format(N)) else: print("{} {}".format(a.count(b),a.count(c)))