import std.algorithm, std.conv, std.range, std.stdio, std.string; import std.regex; // RegEx void main() { auto s = readln.chomp; auto r = 0; while (s.length >= 3) { if (s[0] == 'c') { auto m = s.matchFirst(r"^c[^w]*?w[^w]*?w"); if (!m.empty) r = max(r, m[0].length.to!int); } s = s[1..$]; } writeln(r == 0 ? -1 : r); }