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