N=int(input()) A=list(map(int,input().split())) B=sorted(set(A)) T=0 if len(B)>1:T=A.count(B[1]) elif B[0]