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