import math n = int(input()) a = list(map(int,input().split())) a.sort() ans_u = [] ans_d = [] for idx,num in enumerate(a): same_n = 0 for i in range(idx+1,n): if num == a[i]: same_n += 1 ans_u.append(same_n + 1) ans_d.append(n-idx) ans = math.prod(ans_d) / math.prod(ans_u) print(int(ans))