using System; namespace yukicoder { class Program { static void Main(string[] args) { string s = Console.ReadLine(); int start = 0; int w=0; int end = 0; int ans = 0; if( s.IndexOf("cww") != -1) { ans = 3; } else { start = s.IndexOf("c"); if (start != -1) { w = s.IndexOf("w", start); } if (w != -1) { end = s.IndexOf("w", w + 1); } if(end!=-1) ans=end-start+1; } if (ans == 0) { ans = -1; } Console.WriteLine(ans); } } }