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