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 mut c: Vec = c.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let summary = c.iter().sum::(); if summary < 0 { c = c.into_iter().map(|v| -v).collect(); } c.sort(); c.reverse(); let a = c.iter().step_by(2).sum::(); let b = c.iter().skip(1).step_by(2).sum::(); println!("{}", a.abs() - b.abs()); }