S = input() c, cw, ans = 0, 0, 0 for s in S: if s == "c": c += 1 elif s == "w": ans += cw cw += c print(ans)