S = input() w = S.count("w") ans = 0 for i in range(len(S)): if S[i] == "w": w -= 1 if S[i] == "c": num = w * (w - 1) // 2 ans += num print(ans)