use std::io::{self, BufRead}; fn get_lines() -> Vec { let stdin = io::stdin(); let lines: Vec = stdin.lock().lines().map(|l| l.unwrap()).collect(); return lines; } fn main(){ let s = &get_lines()[0]; let mut sum = 0; for c in s.chars() { if c.is_digit(10) { let n = c.to_digit(10).unwrap(); sum += n; } } println!("{}", sum); }