package main import ( "bufio" "fmt" "io" "os" ) func solve(in io.Reader, out, err io.Writer) { c, w, str := 0, 0, []byte{} fmt.Fscan(in, &str) for i := range str { if str[i] == 'c' { c++ } else { w++ } } if c-1 < w { fmt.Fprintln(out, c-1) } else { fmt.Fprintln(out, w) } } func main() { br := bufio.NewReaderSize(os.Stdin, int(1e4)) solve(br, os.Stdout, os.Stderr) }