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