use std::io::{Read, stdin}; fn main() { let mut buf = String::new(); stdin().read_to_string(&mut buf).unwrap(); let mut tok = buf.split_whitespace(); let mut get = || tok.next().unwrap(); macro_rules! get { ($t:ty) => (get().parse::<$t>().unwrap()); () => (get!(i64)); } let n = get!(); let mut arr = vec![]; for _ in 0..n { arr.push(get!()); } arr.sort(); let mut ans = 0; for i in 0..arr.len() { ans += (arr[i] - (i + 1) as i64).abs(); } println!("{}", ans); }