using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static long[] NList => ReadLine().Split().Select(long.Parse).ToArray(); public static void Main() { Solve(); } static void Solve() { var s = ReadLine(); var ccount = s.Count(c => c == 'c'); WriteLine(Math.Min(ccount - 1, s.Length - ccount)); } }