fn main() { let mut c = String::new(); std::io::stdin().read_line(&mut c).ok(); println!("{}", c.len() - c.matches('0').count() - 2); }