fn get_line() -> String { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s.trim().to_string() } fn main() { println!("{}", get_line().as_bytes().iter().fold(0, |acc, &x| if x == b'n' { acc + 1 } else { acc } ) ); }