n=int(input()) A=list(map(int,input().split())) a,b=A.count(max(A)),A.count(min(A)) if len(set(A))&1: if A[0]//(n-1)==4: a=0 else: b=0 print(a,b)