fn main() { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); println!("{}", s.split('w').count().min(s.split('c').count() - 1) - 1) }