c = w = 0 for i in input()[::-1]: if i == 'w': w += 1 elif i == 'c': c += w * (w-1)//2 print(c)