import java.util.*; import java.math.*; public class Main { private static Scanner sc = new Scanner(System.in); public static void main(String[] args) throws Exception { String s = sc.next(); int ret = 10000; int cnt = 0; for (int i = 0;i < s.length();i++) { if (s.charAt(i)=='c') cnt++; } ret = Math.min(cnt-1,s.length()-cnt); System.out.println(ret); } }