import std.string, std.stdio; void main() { size_t count; ulong ws; foreach_reverse (c; readln.chomp) { if (c == 'c') { count += ws * (ws - 1) / 2; } else if (c == 'w'){ ws++; } } writeln(count); }