import std.stdio, std.array, std.conv, std.string, std.algorithm, std.math, std.regex; void main(){ string s; s = readln().chomp(); auto pos = s.indexOf("c"); if(pos != -1){ s = s[pos..$]; pos = s.lastIndexOf("w"); if(pos != s.indexOf("w")){ writeln(pos+1); return; } } writeln(-1); } // 読み込み用 T readOne(T=size_t)(){ return readln().chomp().split[0].to!T(); } T[] readLine(T=size_t)(string op=" "){ T[] ol; foreach(string elm; readln().chomp().split(op)){ ol ~= elm.to!T(); } return ol; }