#[allow(dead_code)] pub mod uto { pub fn read_string() -> String { let mut buf = String::new(); std::io::stdin().read_line(&mut buf).unwrap(); buf.trim().to_string() } pub fn drop_line() { read_string(); } pub fn read_vec() -> Vec where T: std::str::FromStr + Copy, T::Err: std::fmt::Debug, { read_string() .split_ascii_whitespace() .map(|e| e.parse().unwrap()) .collect::>() } pub fn read_double() -> (T, T) where T: std::str::FromStr + Copy, T::Err: std::fmt::Debug, { let v = read_vec(); (v[0], v[1]) } } fn main() { uto::drop_line(); let a = uto::read_vec::(); let mut score = 0; for e in &a { if !a.contains(&(e - 1)) { score += *e; } } println!("{}", score); }