def main(): S = input() N = len(S) cnt_w = [0] * N for i in range(N-1, -1, -1): cnt_w[i] = (0 if i == N-1 else cnt_w[i + 1]) + (1 if S[i] == 'w' else 0) ans = 0 for i in range(N-1): if S[i] == 'c': ans += cnt_w[i+1] * (cnt_w[i+1]-1) // 2 print(ans) main()