N=int(input()) A=list(map(int,input().split())) if len(set(A))==1: if A[0]//(N-1)==2: print(N,0) else: print(0,N) else: from collections import Counter C=Counter(A) CS=sorted(C,reverse=True) for x in CS: print(C[x],end=" ") print()