using System; using System.Collections.Generic; using System.Linq; public class yukicoder { public static void Main() { int c = 0; int w = 0; foreach(char ch in Console.ReadLine()) { if(ch == 'c') c++; else w++; } if(c > w) Console.WriteLine(w); else Console.WriteLine(c - 1); } }