s = input() a = 1 b = c = d = 0 for i in s: if i == "c": b += a elif i == "w": c,d = c+b,d+c print(d)