s = input() n = len(s) from itertools import product ans = [] for state in product([0,1],repeat=n): t = [c for c in s] nums = 0 symbols = 0 chars = n for i in range(n): if state[i]: if t[i] == 'l' or t[i] == 'o': t[i] = '0' nums += 1 chars -= 1 elif t[i] == 'a' or t[i] == 's': t[i] = '$' symbols += 1 chars -= 1 if nums > 0 and symbols > 0 and chars > 0: ans.append(''.join(t)) ans = set(ans) print(len(ans))