S = input() dp = [0, 0, 0] for s in S: if s == "w": dp[2] += dp[1] dp[1] += dp[0] elif s == "c": dp[0] += 1 print(dp[-1])