import math S = input() S = S[::-1] t = 0 cnt = 0 for i in range(len(S)): if S[i] == "w": t += 1 if S[i] == "c": cnt += math.comb(t, 2) print(cnt)