S = input() c, cw, cww = 0, 0, 0 for s in S: if s == 'c': c += 1 elif s == 'w': cww += cw cw += c print(cww)