import std.algorithm, std.string, std.stdio; void main() { string[] cwws = readln.chomp.split(string.init); string cww = "cww"; size_t count; for (size_t idx; idx < cwws.length - 2; idx++) { for (size_t jdx = idx + 1; jdx < cwws.length - 1; jdx++) { for (size_t kdx = jdx + 1; kdx < cwws.length; kdx++) { if ([idx, jdx, kdx].map!(i => cwws[i]).join == cww) { count++; } } } } writeln(count); }