import math f = math.factorial s = input() l = [x for x in s if x in 'cw'] c = 0 sum = 0 for i in l: c += 1 if i=='c': n = len([x for x in l[c:] if x == 'w']) if n>1: sum += (f(n) // f(n-2)) // f(2) print(sum)