# -*- coding:utf-8 -*- if __name__ == "__main__": n = input() x = map(int,raw_input().split()) x.sort() ans = 0 for i in x: if i % 2 == 1: ans += 1 else: ans -= 1 print abs(ans)