using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.IO; class Iroha { public Iroha() { } public static int Main() { new Iroha().calc(); return 0; } Scanner cin; void calc() { cin = new Scanner(); string S = cin.next(); int ans = Math.Max(0, S.Length - 2); int start = 0; for (int i = 2; i < S.Length; i++) { if(S[i - 2] == 'c' && S[i-1] == 'c' && S[i] == 'w') { start = i - 1; } ans = Math.Min(ans, start + (S.Length - 1 - i)); } Console.WriteLine(ans); } } class Scanner { string[] s; int i; char[] cs = new char[] { ' ' }; public Scanner() { s = new string[0]; i = 0; } public string next() { if (i < s.Length) return s[i++]; string st = Console.ReadLine(); while (st == "") st = Console.ReadLine(); s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries); i = 0; return next(); } public int nextInt() { return int.Parse(next()); } public long nextLong() { return long.Parse(next()); } public double nextDouble() { return double.Parse(next()); } }