def main(): S = input() if len(S) < 3 or 'c' not in S or 'w' not in S: print(0) return ans = 0 idx = [] i = -1 for _ in range(100000): i = S.find('c', i + 1) if i > -1: w = S[i:].count('w') - 1 ans += w * (w + 1) // 2 else: break print(ans) main()