using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace yukikoda { class Program { static void Main(string[] args) { string s = Console.ReadLine(); int min = int.MaxValue; for (int i = 0; i < s.Length - 1; i++) { if (s[i] != 'c') continue; int cnt = 0; for (int j = i; j < s.Length ; j++) { if (s[j] == 'w') { cnt++; } if (cnt == 2) { if (min > j - i) { min = j - i + 1; break; } } } } if (min == int.MaxValue) min = -1; Console.WriteLine(min); } } }