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