fn main() { let s: String = input(); let ans = s.chars().map(|x| x.to_digit(10).unwrap()).fold(0, |x, y| if y == 0 { x + 10 } else { x + y }); println!("{}", ans); } fn input() -> T { use std::io::Read; let stdin = std::io::stdin(); let stdin = stdin.bytes(); let token = stdin .skip_while(|x| (*x.as_ref().unwrap() as char).is_whitespace()) .take_while(|x| !(*x.as_ref().unwrap() as char).is_whitespace()) .map(|x| x.unwrap()) .collect(); let token = String::from_utf8(token).unwrap(); match token.parse() { Ok(x) => x, Err(_) => panic!("{}", token), } }