import re def main(): S = input() if len(S) < 3 or 'c' not in S or 'w' not in S: print(0) return ans = 0 s = re.findall(r'[cw]', S) ci = [i for i, x in enumerate(s) if x == 'c'] for i in ci: w = s[i:].count('w') - 1 ans += w * (w + 1) // 2 print(ans) main()