from math import comb from bisect import bisect_left S = input().rstrip() W = [] for i in range(len(S)): if S[i] == "w": W.append(i) ans = 0 for i in range(len(S)): if S[i] == "c": w = len(W) - bisect_left(W, i) ans += comb(w, 2) print(ans)