using System; using System.Text.RegularExpressions; public class Program { static void Main() { string n = Console.ReadLine(); var x = Regex.Match(n,"c[^w]*w[^w]*w"); Console.WriteLine(x.Length == 0 ? -1:x.Length); } }