S=input()

t=0
w=0
for s in S[::-1]:
    if s=="c":
        t+=(w*(w-1))//2
    elif s=="w":
        w+=1
print(t)