S = input() rep = dict() rep['l'] = '1' rep['o'] = '0' rep['a'] = '@' rep['s'] = '$' ok = set() for i in range(1<<8): T = [] for j in range(8): if (i>>j)&1 and S[j] in rep: T.append(rep[S[j]]) else: T.append(S[j]) a = 0 b = 0 c = 0 for t in T: if "a"<=t<="z": a=1 elif t=='1'or t=='0': b=1 elif t=='@' or t=='$': c=1 if a+b+c==3: ok.add("".join(T)) print(len(ok))