import math n=int(input()) S=str(input()) a=[0]*26 for c in S: a[int(c)]+=1 ret=math.factorial(n) for i in range(26): ret//=math.factorial(a[i]) print(ret%120)