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 mut index: i32 = line.trim().parse().unwrap(); let mut result = 0; while index != 0 { let line = get_line(); let int: i64 = line.trim().parse().unwrap(); result += int; index -= 1; } println!("{}", result); }