mod io { use std::io::{BufRead, ErrorKind}; use std::str::FromStr; pub fn scan(r: &mut R) -> T { let mut tmp = Vec::new(); loop { let buf = match r.fill_buf() { Ok(buf) => buf, Err(e) if e.kind() == ErrorKind::Interrupted => continue, Err(e) => panic!(e), }; let (done, used, buf) = { match buf.iter().position(u8::is_ascii_whitespace) { Some(i) => (i > 0 || tmp.len() > 0, i + 1, &buf[..i]), None => (buf.is_empty(), buf.len(), buf), } }; if done { let buf = { if tmp.is_empty() { buf } else { tmp.extend_from_slice(buf); &tmp } }; let res = unsafe { std::str::from_utf8_unchecked(buf).parse().ok().unwrap() }; r.consume(used); return res; } tmp.extend_from_slice(buf); r.consume(used); } } } fn main() { let stdin = std::io::stdin(); let mut reader = std::io::BufReader::new(stdin.lock()); let n: usize = io::scan(&mut reader); println!("{}", (0..n).map(|_| io::scan::<_, u64>(&mut reader)).sum::()); }