// tested by Hightail - https://github.com/dj3500/hightail import std.stdio, std.string, std.conv, std.algorithm; import std.range, std.array, std.math, std.typecons, std.container, core.bitop; void main() { int n = readln.chomp.to!int; auto x = readln.split.to!(int[]); int ev, od; foreach (xi ; x) { if (xi & 1) od++; else ev++; } writeln(abs(ev - od)); } void scan(T...)(ref T args) { string[] line = readln.split; foreach (ref arg; args) { arg = line.front.to!(typeof(arg)); line.popFront(); } assert(line.empty); }