S = input().strip() total = 1 for c in S: if c in {'a', 'l', 'o', 's'}: total *= 2 def calculate_A(s): for c in s: if c not in {'a', 'l', 'o', 's'}: return 0 return 1 # All characters are a, l, o, s and all are replaced def calculate_B(s): has_l_or_o = any(c in {'l', 'o'} for c in s) if not has_l_or_o: return total res = 1 for c in s: if c == 'l': res *= 1 elif c == 'o': res *= 1 elif c == 'a': res *= 2 elif c == 's': res *= 2 else: res *= 1 return res def calculate_C(s): has_a_or_s = any(c in {'a', 's'} for c in s) if not has_a_or_s: return total res = 1 for c in s: if c == 'a': res *= 1 elif c == 's': res *= 1 elif c == 'l': res *= 2 elif c == 'o': res *= 2 else: res *= 1 return res def calculate_BC(s): res = 1 for c in s: res *= 1 return res A = calculate_A(S) B = calculate_B(S) C = calculate_C(S) AB = 0 if A != 0: has_l_or_o = any(c in {'l', 'o'} for c in S) if not has_l_or_o: AB = A AC = 0 BC = calculate_BC(S) ABC = 0 valid = total - (A + B + C) + (AB + AC + BC) - ABC print(valid)