using System; namespace Yukicoder { public class Program { public static void Main(string[] args) { var cw = Console.ReadLine(); int len = cw.Length; int c = 0; int w = 0; for (int i = 0; i < len; i++) { if (cw[i] == 'c') { c++; } else { w++; } } Console.WriteLine( c - 1 > 0 && w > 0 ? Math.Min(c - 1, w) : 0 ); } } }