import math s = input() c = 0 for i in range(len(s)): if s[i] == 'c': if 'w' in s: w = s[i:].count('w') if w > 1: c += math.factorial(w) // (math.factorial(w - 2) * math.factorial(2)) print(c)