import math._ object Main { def main(args: Array[String]) { val sc = new java.util.Scanner(System.in) val n = sc.nextInt val xs = (1 to n) map { _ => sc.nextInt } val evens = xs filter { e => abs(e) % 2 == 0 } val odds = xs filter { e => abs(e) % 2 == 1 } println(abs(evens.length - odds.length)) } }