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 { for(int i = 0; i < s.Length-1; i++) { start = s.IndexOf("c",i); if (start != -1) { w = s.IndexOf("w", start); } if (w != -1) { end = s.IndexOf("w", w + 1); } else { break; } if (end != -1) { ans = end - start+1; } } } if (ans == 0) { ans = -1; } Console.WriteLine(ans); } } }