s = input() cnt = 0 cww = 0 for i in range(len(s)-1,-1,-1): if s[i]=="w": cnt+=1 elif s[i]=="c" and cnt>1: cww += (cnt*(cnt-1))//(2) print(cww)