using System; using System.Linq; namespace y { class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); int[] x = Console.ReadLine().Split().Select(z => int.Parse(z)).ToArray(); int o = 0; int e = 0; foreach (var i in x) { if (i % 2 == 0) e++; else o++; } if (e >= o)Console.WriteLine(e - o); else Console.WriteLine(o - e); } } }