from math import comb S = input() w = 0 ans = 0 for c in reversed(S): if c == 'w': w += 1 elif c == 'c': ans += comb(w, 2) print(ans)