from math import factorial s = input() num = 0 kigou = 0 for i in s: if i == "l" or i == "o": num += 1 if i == "a" or i == "s": kigou += 1 if num == 0 or kigou == 0: print(0) else: n = num nums = 0 for r in range(1, n + 1): nums += factorial(n) / (factorial(r) * factorial(n-r)) n = kigou kigous = 0 for r in range(1, n + 1): kigous += factorial(n) / (factorial(r) * factorial(n-r)) print(int(nums * kigous))