S = input() wc = S.count('w') ans = 0 for s in S: if s == 'w': wc -= 1 if s == 'c': ans += ((wc-1)*wc)//2 print(ans)