import sys input=lambda: sys.stdin.readline().rstrip() S=input() a,b,c=0,0,0 for s in S: if s=="c": a+=1 elif s=="w": c+=b b+=a print(c)