fn get_line() -> String { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s.trim().to_string() } fn main() { let mut c = 0; let mut w = 0; for &x in get_line().as_bytes() { if x == b'c' { c += 1; } else { w += 1; } } println!("{}", if c - 1 < w { c - 1 } else { w } ); }