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