n=int(input()) ns=list(map(int,input().split())) ns.sort() cnt=1 bunbo=n ans=1 for i in range(1,n): if ns[i-1] == ns[i]: cnt+=1 continue while cnt: ans *= 1/(cnt/bunbo) cnt-=1 bunbo-=1 cnt+=1 print(int(ans))