fn main() { let mut line = String::new(); let _ = std::io::stdin().read_line(&mut line); let total = line.chars().filter_map(|s| s.to_digit(10)).map(|s| s as i32).fold(0, |sum, i| sum + i); println!("{}", total); }