// Arup Guha
// 1/28/2021
// Solution to 2021 USACO January Bronze Problem: Even More Odd Photos

import java.util.*;

public class evenodd {

	public static void main(String[] args) {
	
		Scanner stdin = new Scanner(System.in);
		int n = stdin.nextInt();
		
		// Just count how many evens and odds.
		int nEven=0, nOdd = 0;
		for (int i=0; i<n; i++) {
			int val = stdin.nextInt();
			if (val%2 == 0) nEven++;
			else			nOdd++;
		}
		
		// Turn 2 odds into 1 even until we cross over...
		if (nOdd > nEven) {
			int nTimes = (nOdd-nEven+2)/3;
			nOdd -= (2*nTimes);
			nEven += nTimes;
		}
		
		// Just two cases now...
		int res = 0;
		if (nEven > nOdd) 
			res = 2*nOdd + 1;
		else
			res = 2*nOdd;
		
		// Ta da!
		System.out.println(res);
	}	
}