fn main() { let mut input = String::new(); std::io::Read::read_to_string(&mut std::io::stdin(), &mut input).ok(); let input: Vec = input .split_whitespace() .map(|n| n.parse().unwrap()) .collect(); let n_even = input[1..].iter().filter(|n| n.rem_euclid(2) == 0).count(); let n_odd = input[1..].len() - n_even; println!("{:?}", n_even.abs_diff(n_odd)); }