use std::io::stdin; fn get_line() -> String { let mut line = String::new(); stdin().read_line(&mut line).ok(); line } fn main() { let line = get_line(); let line = line.as_str(); let mut result = 0; for i in line.chars() { if i.is_numeric() { result += i.to_digit(10).unwrap(); } } println!("{}", result); }