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