cn=wn=0 for c in input()[::-1]: if c=='w': wn += 1 elif c=='c': cn += wn*(wn-1)//2 print(cn)