using System.Linq; using System; public class Hello { public static void Main() { var s = Console.ReadLine().Trim(); var cc = s.Count(x => x == 'c'); var sL = s.Length; var ww = sL - cc; Console.WriteLine(Math.Min(cc - 1, ww)); } }