#!/usr/bin/env python3 #fileencoding: utf-8 N = int(input()) print(abs(sum([1 if int(i)%2==0 else -1 for i in input().strip().split(" ")])))