import std.algorithm, std.conv, std.range, std.stdio, std.string; import std.regex; // RegEx void main() { auto s = readln.chomp; auto m = s.matchAll(r"c[^cw]*?w[^w]*?w"); auto r = 0; foreach (mi; m) r = max(r, mi[0].length.to!int); writeln(r == 0 ? -1 : r); }