import sys read=sys.stdin.buffer.read readline=sys.stdin.buffer.readline readlines=sys.stdin.buffer.readlines s=readline().rstrip().decode() n=len(s) import numpy as np MOD=573 comb=np.zeros((n+1, n+1), np.int32) comb[0][0]=1 for i in range(1, n+1): comb[i][:i]+=comb[i-1][:i] comb[i][1:i+1]+=comb[i-1][:i] comb[i]%=MOD from collections import Counter c=Counter(s) ans=1 x=n for y in c.values(): ans*=comb[x][y] ans%=MOD x-=y print((ans-1)%MOD)