use std::io; fn main() { let mut line = String::new(); io::stdin().read_line(&mut line).expect("Error on reading lines"); println!("{}", line.trim_end().chars().fold(0, |s, c| s + (c as i32 - 48))); }