A flower shop has got n bouquets, and the i-th bouquet consists of a_{i} flowers. Vasya, the manager of the shop, decided to make large bouquets from these bouquets. 

Vasya thinks that a bouquet is large if it is made of two or more initial bouquets, and there is a constraint: the total number of flowers in a large bouquet should be odd. Each of the initial bouquets can be a part of at most one large bouquet. If an initial bouquet becomes a part of a large bouquet, all its flowers are included in the large bouquet.

Determine the maximum possible number of large bouquets Vasya can make. 


-----Input-----

The first line contains a single positive integer n (1 ≤ n ≤ 10^5) — the number of initial bouquets.

The second line contains a sequence of integers a_1, a_2, ..., a_{n} (1 ≤ a_{i} ≤ 10^6) — the number of flowers in each of the initial bouquets.


-----Output-----

Print the maximum number of large bouquets Vasya can make. 


-----Examples-----
Input
5
2 3 4 2 7

Output
2

Input
6
2 2 6 8 6 12

Output
0

Input
3
11 4 10

Output
1



-----Note-----

In the first example Vasya can make 2 large bouquets. For example, the first bouquet can contain the first and the fifth initial bouquets (the total number of flowers is then equal to 9), and the second bouquet can consist of the second and the third initial bouquets (the total number of flowers is then equal to 7). The fourth initial bouquet is unused in this scheme. 

In the second example it is not possible to form a single bouquet with odd number of flowers.

In the third example Vasya can make one large bouquet. For example, he can make it using all three initial bouquets. The size of the large bouquet is then equal to 11 + 4 + 10 = 25.

Source: codeforces | Difficulty: MEDIUM


Solutions:
n = int(input())
m = list(map(int, input().split()))
c = 0
for i in m:
	if i % 2:
		c += 1
uc = n - c
if c <= uc:
	print(c)
	exit()
b = (c - uc) // 3
c -= b * 3
print(b + min(uc, c))


s = 0
q = 0
n = int(input())
qq = 0
w = str(input())
w1 = w.split()
while qq < n:
	qwe = int(w1[qq])
	if qwe % 2 == 0:
		s = s + 1
	else:
		q = q + 1
	qq = qq + 1
if q <= s:
	print(q)
else:
	print(s + (q - s) // 3)


n = map(int, input().split())
a = sorted(list(map(int, input().split())))
t2 = 0
t1 = 0
for it in a:
	if it % 2 == 0:
		t2 = t2 + 1
	else:
		t1 = t1 + 1
ans = min(t1, t2)
t1 -= ans
ans += int(t1) // 3
print(ans)


n = int(input())
arr = [int(x) for x in input().split()]
(o, e) = (0, 0)
for i in arr:
	if i % 2 == 0:
		e += 1
	else:
		o += 1
if e >= o:
	print(o)
else:
	o -= e
	print(e + o // 3)


n = int(input())
f = list(map(int, input().split()))
cnt1 = 0
cnt2 = 0
for i in range(n):
	if f[i] % 2 != 0:
		cnt1 += 1
	else:
		cnt2 += 1
if cnt1 <= cnt2:
	print(cnt1)
else:
	print(cnt2 + (cnt1 - cnt2) // 3)


import sys
num = int(sys.stdin.readline())
fl = map(int, sys.stdin.readline().split())
odd = 0
even = 0
for f in fl:
	if f % 2:
		odd += 1
	else:
		even += 1
res = min(even, odd)
odd -= even
if odd > 0:
	res += odd // 3
print(res)


n = int(input())
a = list(map(int, input().split()))
q = [0] * 2
for i in range(n):
	q[a[i] % 2] += 1
x = min(q[0], q[1])
q[0] -= x
q[1] -= x
print(x + q[1] // 3)


n = int(input())
mas = map(int, input().split())
odd = 0
even = 0
for i in mas:
	if i % 2 == 0:
		even = even + 1
	else:
		odd = odd + 1
ans = min(odd, even)
odd = odd - ans
ans += int(odd / 3)
print(ans)


from math import *
n = int(input())
c = 0
nc = 0
k = input().split(' ')
for i in range(n):
	if int(k[i]) % 2 == 0:
		c = c + 1
	else:
		nc = nc + 1
tt = min(c, nc) + max(0, nc - min(c, nc)) // 3
print(tt)


n = int(input())
a = list(map(int, input().split()))
ev = 0
od = 0
for i in a:
	if i % 2:
		od += 1
	else:
		ev += 1
ans = min(ev, od)
od -= ans
ev -= ans
ans += od // 3
print(ans)


n = int(input(''))
even = 0
odd = 0
ls = map(int, input('').split(' '))
for i in ls:
	if i % 2 == 0:
		even += 1
	else:
		odd += 1
ans = 0
while even > 0 and odd > 0:
	ans += 1
	even -= 1
	odd -= 1
ans += int(odd / 3)
print(ans)


import math
n = int(input())
val = list(map(int, input().split()))
even = int(0)
odd = int(0)
for i in range(n):
	if val[i] % 2 == 0:
		even += 1
	else:
		odd += 1
ans = int(0)
ans += min(even, odd)
tt = min(even, odd)
even -= tt
odd -= tt
if odd >= 3:
	ans += int(odd / 3)
print(ans)


def is_odd(a):
	return bool(a & 1)

def main():
	n = int(input())
	even = 0
	odd = 0
	for a in map(int, input().split()):
		if is_odd(a):
			odd += 1
		else:
			even += 1
	cnt = min(even, odd)
	if odd > even:
		odd -= even
		cnt += odd / 3
	print(int(cnt))
main()


n = int(input())
a = [int(x) for x in input().split()]
x = 0
for i in range(0, n):
	if a[i] % 2 == 1:
		x = x + 1
cnt = n - x
if cnt > x:
	cnt = x
x = x - (n - x)
if x > 0:
	cnt += int(x / 3)
print(cnt)


n = int(input())
mas = list(map(int, input().split()))
r1 = [i for i in mas if i % 2 == 0]
r2 = [i for i in mas if i % 2 != 0]
r1 = len(r1)
r2 = len(r2)
if min(r1, r2) == r2:
	k = r2
else:
	k = r1 + (r2 - r1) // 3
print(k)


n = int(input())
s = input().split()
c1 = 0
for i in s:
	el = int(i)
	c1 += el & 1
c2 = n - c1
res = min(c1, c2)
while c1 >= 2:
	c1 -= 2
	c2 += 1
	res = max(res, min(c1, c2))
print(res)


n = int(input())
a = list(map(int, input().split()))
k = 0
d = 0
for i in range(n):
	if a[i] % 2 == 1:
		k += 1
	else:
		d += 1
	if k < d:
		ma = k
	else:
		ma = d
while k > 2:
	k -= 2
	d += 1
	if k < d:
		if k > ma:
			ma = k
	elif d > ma:
		ma = d
print(ma)


n = int(input())
a = list(map(int, input().split()))
even = 0
odd = 0
for v in a:
	if v & 1:
		odd += 1
	else:
		even += 1
ans = min(even, odd)
if odd > even:
	odd -= even
	ans += odd // 3
print(ans)


n = int(input())
arr = list(map(int, input().split()))
(odds, evens) = (0, 0)
for i in arr:
	if i % 2 == 0:
		evens += 1
	else:
		odds += 1
if odds < evens:
	print(odds)
else:
	odds -= evens
	print(evens + odds // 3)


n = int(input())
a = [int(x) for x in input().split()]
odd = [0, 0]
for i in range(n):
	odd[a[i] % 2] += 1
ans = min(odd)
ans += int((odd[1] - ans) / 3)
print(ans)


n = u = o = 0
cnt = 0
n = int(input())
i = 0
x = input()
x = x + '                     '
while cnt < n:
	if x[i] is ' ':
		i += 1
		continue
	else:
		a = int(x[i])
		if x[i + 1] is ' ':
			if a % 2 == 0:
				u += 1
			else:
				o += 1
			cnt += 1
	i += 1
ans = min(u, o)
u -= ans
o -= ans
ans += int(o / 3)
print(ans)


a = int(input())
b = 0
c = 0
for x in list(map(int, input().split())):
	if x % 2 == 0:
		b += 1
	else:
		c += 1
if b > c:
	print(c)
elif b == c:
	print(c)
else:
	c = b + (c - b) // 3
	print(c)


n = int(input())
flowers = input().split()
odd = 0
ott = 0
for val in flowers:
	if int(val) % 2 == 0:
		odd += 1
	else:
		ott += 1
while ott > odd + 2:
	ott -= 2
	odd += 1
print(min(odd, ott))


n = int(input())
a = map(int, input().split())
odd = 0
even = 0
for x in a:
	if x % 2 == 1:
		odd = odd + 1
	if x % 2 == 0:
		even = even + 1
if odd < even:
	even = odd
odd = odd - even
print(even + int(odd / 3))


n = int(input())
odd = 0
even = 0
t = input().split(' ')
for i in range(0, n):
	x = int(t[i])
	if x % 2 == 0:
		even += 1
	else:
		odd += 1
ans = min(odd, even)
odd -= ans
ans += odd // 3
print(ans)


n = int(input())
arr = [int(z) for z in input().split()]
(o, e) = (0, 0)
for i in arr:
	if i % 2:
		o += 1
	else:
		e += 1
b = min(o, e)
b += max(0, o - e) // 3
print(b)


n = int(input())
a = [int(i) for i in input().split()]
nechet = [i % 2 for i in a].count(True)
chet = n - nechet
first = min(nechet, chet)
diff = nechet - chet
diff = diff // 3 if diff > 0 else 0
print(first + diff)


N = input()
B = [int(i) for i in input().split()]
(a, b) = (0, 0)
for i in B:
	if i % 2 == 0:
		b = b + 1
	else:
		a = a + 1
if a <= b:
	print(a)
else:
	a = a - b
	print(b + a // 3)


cntn = 0
cntc = 0
n = int(input())
s = input().split(' ')
for i in s:
	if int(i) % 2 == 0:
		cntn = cntn + 1
	else:
		cntc = cntc + 1
k = min(cntc, cntn)
if cntc > cntn:
	k = max(k, cntn + (cntc - cntn) // 3)
print(k)


n = int(input())
a = list(map(int, input().split()))
b = 0
c = 0
for i in a:
	if i % 2 == 0:
		b += 1
	else:
		c += 1
d = min(b, c)
b -= d
c -= d
if c <= 0:
	print(d)
else:
	f = c // 3
	d += f
	print(d)


n = int(input())
o = sum(map(lambda x: int(x) & 1, input().split()))
e = min(n - o, o)
o -= e
print(e + o // 3)


n = int(input())
l = 0
k = 0
arr = list(map(int, input().split()))
for i in range(0, n):
	if arr[i] % 2 == 0:
		l = l + 1
	if arr[i] % 2 == 1:
		k = k + 1
if l > k:
	print(k)
else:
	print(l + (k - l) // 3)


import sys
read = lambda : sys.stdin.readline().strip()
readi = lambda : map(int, read().split())
from collections import *
n = int(read())
nums = list(readi())
odds = 0
for num in nums:
	if num & 1 == 1:
		odds += 1
ans = 0
ans += min(odds, n - odds)
odds -= ans
ans += odds // 3
print(ans)


from sys import stdin
from collections import defaultdict
input = stdin.readline
T = 1
for t in range(1, T + 1):
	n = int(input())
	_input = list(map(int, input().split()))
	even_count = 0
	odd_count = 0
	for i in _input:
		even_count += i % 2 == 0
		odd_count += i & 1
	print(int(min(even_count, odd_count) + (odd_count - min(even_count, odd_count)) / 3))


import os
import sys
import math
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
t = int(input())
odd = 0
even = 0
a = list(map(int, input().split()))
for i in range(t):
	n = a[i]
	if n % 2 == 0:
		even += 1
	else:
		odd += 1
count = min(odd, even)
odd -= count
count += odd // 3
print(count)


n = input()
kol_vo_chet = 0
kol_vo_nechet = 0
nb = input().split()
for i in nb:
	if int(i, 10) % 2 == 0:
		kol_vo_chet += 1
	else:
		kol_vo_nechet += 1
answ = 0
answ = min(kol_vo_nechet, kol_vo_chet)
kol_vo_nechet -= answ
if kol_vo_nechet != 0:
	answ += kol_vo_nechet // 3
print(answ)


n = int(input())
arr = list(map(int, input().split()))
even = 0
odd = 0
for i in arr:
	if i % 2 == 0:
		even += 1
	else:
		odd += 1
if odd == 0:
	print(0)
elif odd < even:
	print(odd)
elif odd == even:
	print(odd)
else:
	print(even + int((odd - even) // 3))


n = int(input())
s = input().split(' ')
a = 0
b = 0
for i in s:
	if int(i) % 2 == 1:
		a += 1
	else:
		b += 1
if a < b:
	print(a)
else:
	print(b + (a - b) // 3)


nec = c = ans = 0

def Sort(x):
	global c, nec
	s = int(x) % 2 == 0
	if s:
		c += 1
	else:
		nec += 1
	return s
a = input()
List = list(map(Sort, input().split()))
if nec:
	if not c:
		print(nec // 3)
	else:
		n = min(nec, c)
		ans += n
		nec -= n
		c -= n
		if nec:
			ans += nec // 3
			print(ans)
		else:
			print(ans)
else:
	print(0)


a = input()
mas = input()
mas = mas.split(' ')
chet = 0
nechet = 0
temp = 0
for i in range(0, int(a)):
	if int(mas[i]) % 2 == 0:
		chet += 1
	else:
		nechet += 1
if chet >= nechet:
	print(nechet)
elif nechet > chet:
	temp = chet + int((nechet - chet) / 3)
	print(temp)


n = int(input())
a = [int(x) for x in input().split()]
odd = [x for x in a if x % 2 == 1]
even = [x for x in a if x % 2 == 0]
ans = 0
while len(odd) != 0:
	if len(even) > 0:
		odd.pop()
		even.pop()
		ans += 1
	else:
		ans += len(odd) // 3
		break
print(ans)


n = int(input())
a = list(map(int, input().split()))
odd = 0
even = 0
for i in a:
	if i % 2 != 0:
		odd += 1
	else:
		even += 1
if odd <= even:
	print(min(odd, even))
else:
	diff = odd - even
	print(min(odd, even) + diff // 3)


n = int(input())
cnt = [0] * 2
for a in input().split():
	cnt[int(a) % 2] += 1
ans = min(cnt[0], cnt[1])
cnt[0] -= ans
cnt[1] -= ans
ans += cnt[1] // 3
print(ans)


n = int(input())
arr = map(int, input().split())
res = 0
for x in arr:
	res = res + x % 2
finalres = min(n - res, res)
res = res - finalres
finalres = finalres + res // 3
print(finalres)


n = int(input())
s = list(map(int, input().split()))
oddd = 0
evend = 0
for i in range(n):
	if s[i] % 2 == 0:
		oddd += 1
	else:
		evend += 1
if evend == 0:
	print(0)
elif oddd == 0:
	print(evend // 3)
elif oddd < evend:
	print(oddd + (evend - oddd) // 3)
else:
	print(evend)


def min(a, b):
	if a >= b:
		return b
	else:
		return a
b = 0
n = int(input())
a = input().split()
for i in range(len(a)):
	a[i] = int(a[i])
for i in range(n):
	if a[i] % 2 == 0:
		b += 1
c = n - b
ans = min(b, c)
if b < c:
	ans += (c - b) // 3
print(ans)


import math
from typing import List, Any
n = input()
arr = input().split(' ')
odd = 0
even = 0
for i in range(len(arr)):
	if int(arr[i]) % 2 != 0:
		odd += 1
	else:
		even += 1
mn = min(odd, even)
r = mn
even -= mn
odd -= mn
r += math.floor(odd / 3)
print(math.floor(r))


n = int(input())
a = 0
b = 0
for x in input().split():
	x = int(x)
	if x % 2 == 0:
		a += 1
	else:
		b += 1
res = b
if a < b:
	res = a + (b - a) // 3
print(res)


n = int(input())
f = input().split(' ')
a = 0
b = 0
for i in range(0, n):
	g = int(f[i])
	if g % 2 == 0:
		a += 1
	else:
		b += 1
if a > b:
	print(b)
else:
	print(a + (b - a) // 3)