package test; import java.util.Arrays; import java.util.Scanner; public class No436 { void run() { Scanner sc = new Scanner(System.in); String s = sc.next(); int c = 0,w = 0; for(char x:s.toCharArray()){ if(x == 'c'){ c++; } else{ w++; } } if(c - 1 >= w) System.out.println(w); else { System.out.println(c-1); } } void debug(Object... o) { System.out.println(Arrays.deepToString(o)); } public static void main(String[] args) { new No436().run(); } }