use std::io; use std::io::prelude::*; fn main() { let mut s: String = String::new(); std::io::stdin().read_line(&mut s).ok(); let stdout = io::stdout(); let mut stdout = io::BufWriter::new(stdout.lock()); let n: u32 = s.trim() .chars() .map(|c| c.to_digit(10) .unwrap()) .sum(); writeln!(stdout, "{}", n).unwrap_or(()); }