#coding: UTF-8 import sys import re import itertools from math import sqrt from collections import deque ### defs ### ### main ### N = int(sys.stdin.readline()) X = list(map(int, sys.stdin.readline().split())) print(N-2*min(len(list(filter(lambda x:x%2==0,X))), len(list(filter(lambda x:x%2==1,X)))))