def main(): s=input() w=0 ans=0 for c in s[::-1]: if c=="w":w+=1 if c=="c" and w>=2:ans+=w*(w-1)//2 print(ans) main()