import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String s = br.readLine(); int c = 0, w = 0; for(int i = 0; i < s.length(); i++){ if(s.charAt(i) == 'c') c++; else w++; } System.out.println(Math.min(c - 1, w)); } }