s = input() cnt_w = 0 total = 0 for i in reversed(range(len(s))): if s[i] == "w": cnt_w += 1 elif s[i] == "c": total += cnt_w * (cnt_w-1) / 2 print(int(total))