fn main() { let mut n = String::new(); std::io::stdin().read_line(&mut n).ok(); let n: usize = n.trim().parse().unwrap(); let mut c = String::new(); std::io::stdin().read_line(&mut c).ok(); let c: Vec = c.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let summary = c.iter().sum::(); let mut c = if summary < 0 { c.into_iter().map(|v| -v).collect::>() } else { c }; c.sort(); c.reverse(); let aval = c.iter().step_by(2).sum::(); let bval = c.iter().skip(1).step_by(2).sum::(); println!("{}", aval.abs() - bval.abs()); }