import re def main(): S = input() result = 0 for idx in [x.start() for x in re.finditer(r'c', S)]: result += sum(range(len(re.findall('w', S[idx + 1:])))) print(result) if __name__ == '__main__': main()