S = input() W = S.count("w") T = 0 for C in S: if C == "c": T += W * (W - 1) / 2 elif C == "w": W -= 1 print(int(T))