mod io { pub fn scan(r: &mut R) -> Vec { let mut res = Vec::new(); loop { let buf = match r.fill_buf() { Ok(buf) => buf, Err(e) if e.kind() == std::io::ErrorKind::Interrupted => continue, Err(e) => panic!(e), }; let (done, used) = match buf.iter().position(u8::is_ascii_whitespace) { Some(i) => { res.extend_from_slice(&buf[..i]); (res.len() > 0, i + 1) } None => { res.extend_from_slice(buf); (buf.is_empty(), buf.len()) } }; r.consume(used); if done { return res; } } } } #[allow(unused_macros)] fn run(reader: &mut R, writer: &mut W) { macro_rules! scan { ($($($v:ident)*: $t:tt),*, $(,)?) => ($(let $($v)* = scan!($t);)*); ([$t:tt; $n:expr]) => ((0..$n).map(|_| scan!($t)).collect::>()); (($($t:tt),*)) => (($(scan!($t)),*)); ([u8]) => (io::scan(reader)); (String) => (scan!([u8]).into_iter().map(char::from).collect::()); ($t:ty) => (scan!(String).parse::<$t>().unwrap()); } macro_rules! print { ($($arg:tt)*) => (write!(writer, $($arg)*).ok()); } macro_rules! println { ($($arg:tt)*) => (writeln!(writer, $($arg)*).ok()); } let n = scan!(usize); let a = scan!([u64; n]); println!("{}", a.iter().sum::()); } fn main() { let (stdin, stdout) = (std::io::stdin(), std::io::stdout()); let mut reader = std::io::BufReader::new(stdin.lock()); let mut writer = std::io::BufWriter::new(stdout.lock()); run(&mut reader, &mut writer); }