use std::io::{self, Read}; fn read_usize(reader: &mut R) -> usize { reader .by_ref() .bytes() .filter_map(|b| b.ok()) .skip_while(|&b| b < b'0' || b > b'9') .take_while(|&b| b >= b'0' && b <= b'9') .map(|b| (b - b'0') as usize) .fold(0, |res, n| res * 10 + n) } fn read_u64(reader: &mut R) -> u64 { reader .by_ref() .bytes() .filter_map(|b| b.ok()) .skip_while(|&b| b < b'0' || b > b'9') .take_while(|&b| b >= b'0' && b <= b'9') .map(|b| (b - b'0') as u64) .fold(0, |res, n| res * 10 + n) } fn main() { let stdin = io::stdin(); let mut stdin = stdin.lock(); let n: usize = read_usize(&mut stdin); let sum: u64 = (0..n).map(|_| read_u64(&mut stdin)).sum(); println!("{}", sum); }