import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); char[] arr = sc.next().toCharArray(); int length = arr.length; int count = 0; for (char c : arr) { if (c == 'c') { count++; } } System.out.println(Math.min(count - 1, length - count)); } }