S = input() a0 = a1 = a2 = a3 = 0 a0 = 1 for s in S: if s == "w": a3 += a2 a2 += a1 elif s == "c": a1 += a0 print(a3)