import math S = input() l = list(S) l.reverse() w_count = 0 sum = 0 for l_i in l: if l_i == "w": w_count += 1 if l_i == "c": if w_count >= 2: sum += int(math.factorial(w_count) / (2 * math.factorial(w_count - 2))) print(sum)