You are at a water bowling training. There are l people who play with their left hand, r people, who play with their right hand, and a ambidexters, who can play with left or right hand.

The coach decided to form a team of even number of players, exactly half of the players should play with their right hand, and exactly half of the players should play with their left hand. One player should use only on of his hands.

Ambidexters play as well with their right hand as with their left hand. In the team, an ambidexter can play with their left hand, or with their right hand.

Please find the maximum possible size of the team, where equal number of players use their left and right hands, respectively.


-----Input-----

The only line contains three integers l, r and a (0 ≤ l, r, a ≤ 100) — the number of left-handers, the number of right-handers and the number of ambidexters at the training. 


-----Output-----

Print a single even integer — the maximum number of players in the team. It is possible that the team can only have zero number of players.


-----Examples-----
Input
1 4 2

Output
6

Input
5 5 5

Output
14

Input
0 2 0

Output
0



-----Note-----

In the first example you can form a team of 6 players. You should take the only left-hander and two ambidexters to play with left hand, and three right-handers to play with right hand. The only person left can't be taken into the team.

In the second example you can form a team of 14 people. You have to take all five left-handers, all five right-handers, two ambidexters to play with left hand and two ambidexters to play with right hand.

Source: codeforces | Difficulty: EASY
Tags: Mathematics

Implementation


Solutions:
(a, b, c) = map(int, input().split())
x = abs(a - b)
if x >= c:
	print((c + min(a, b)) * 2)
else:
	print((x + min(a, b) + int((c - x) / 2)) * 2)


(l, r, a) = map(int, input().split())
for i in range(a):
	if l < r:
		l += 1
	elif l > r:
		r += 1
	else:
		l += 1
if l != r:
	print(2 * min(l, r))
else:
	print(2 * l)


(l, r, a) = input().split()
l = int(l)
r = int(r)
a = int(a)
dif = abs(r - l)
if r < l:
	r += min(a, l - r)
	a -= min(a, dif)
else:
	l += min(a, r - l)
	a -= min(a, dif)
if a > 0:
	print(2 * (r + a // 2))
else:
	print(2 * min(r, l))


(l, r, a) = input().split()
l = int(l)
r = int(r)
a = int(a)
counter = 0
required = 0
if l > r:
	required = l - r
	counter += r
	if a > required:
		a = a - required
		counter = 2 * l
		counter += int(a / 2) * 2
	else:
		counter += a
		counter *= 2
else:
	required = r - l
	counter += l
	if a > required:
		a = a - required
		counter = 2 * r
		counter += int(a / 2) * 2
	else:
		counter += a
		counter *= 2
print(counter)


(l, r, a) = map(int, input().split())
if a > abs(l - r):
	ans = max(l, r) + (a - abs(l - r)) // 2
else:
	ans = min(l, r) + a
print(ans * 2)


(a, b, c) = map(int, input().split())
maximo = max(a, b)
minimo = min(a, b)
resta = maximo - minimo
if c <= resta:
	minimo += c
	c = 0
else:
	minimo += resta
	c -= resta
print(min(maximo, minimo) * 2 + c // 2 * 2)


(l, r, a) = [int(x) for x in input().split()]
while l < r and a != 0:
	l += 1
	a -= 1
while r < l and a != 0:
	r += 1
	a -= 1
l += a // 2
r += a // 2
print(min(l, r) * 2)


(l, r, a) = (int(i) for i in input().split())
(L, R) = (l, r)
if L > R:
	tmp = min(L - R, a)
	a -= tmp
	R += tmp
else:
	tmp = min(R - L, a)
	a -= tmp
	L += tmp
L += a // 2
R += a // 2
if L > R and a % 2 != 0:
	R += 1
elif R > L and a % 2 != 0:
	L += 1
print(2 * min(L, R))


(l, r, a) = map(int, input().split())
m = min(l, r)
z = m + a
if z <= max(l, r):
	print(2 * z)
else:
	q = (l + r + a) // 2
	print(2 * q)


arri = lambda : [int(s) for s in input().split()]
(l, r, a) = arri()
(x, y) = (min(l, r), max(l, r))
s = 0
if x + a < y:
	s = x + a
else:
	s = y + (a - (y - x)) // 2
print(s * 2)


num = [int(i) for i in input().split()]
if num[0] == num[1]:
	if num[2] % 2 == 0:
		print(int(sum(num)))
	else:
		print(int(sum(num) - 1))
elif num[2] == abs(num[0] - num[1]):
	print(int(sum(num)))
elif num[2] > abs(num[0] - num[1]):
	if (num[2] - abs(num[0] - num[1])) % 2 == 0:
		print(int(sum(num)))
	else:
		print(int(sum(num) - 1))
elif num[1] > num[0]:
	print(int((num[0] + num[2]) * 2))
else:
	print(int((num[1] + num[2]) * 2))


from math import *
A = []
A = input().split()
B = []
B.insert(0, int(A[0]))
B.insert(1, int(A[1]))
B.insert(2, int(A[2]))
count = min(B[0], B[1])
razn = abs(B[0] - B[1])
if B[2] >= razn:
	count += razn
	B[2] = B[2] - razn
	B[2] = B[2] / 2
	count += int(B[2])
else:
	count += B[2]
print(count * 2)


(l, r, a) = map(int, input().split())
if l < r:
	(l, r) = (r, l)
d = l - r
if a > d:
	print((r + d + (a - d) // 2) * 2)
else:
	print((r + a) * 2)


I = input()
myIntegers = [int(x) for x in I.split()]
l = myIntegers[0]
r = myIntegers[1]
a = myIntegers[2]
if r > l:
	t = r
	r = l
	l = t
max = 0
if l == r:
	print(l + r + a & ~1)
elif r + a <= l:
	print(2 * (r + a))
else:
	a = a + r - l
	print(2 * l + a & ~1)


from math import *
(l, r, a) = map(int, input().split())
ans = 0
maxi = max(l, r)
mini = l + r - maxi
if maxi - mini > a:
	print(min(maxi, mini + a) * 2)
else:
	print((maxi + (a + mini - maxi) // 2) * 2)


(l, r, a) = list(map(int, input().split()))
if l < r:
	mmin = l
	mmax = r
else:
	mmin = r
	mmax = l
s = mmax - mmin
if a >= s:
	print(mmax * 2 + (a - s) // 2 * 2)
else:
	print((mmin + a) * 2)


from math import floor
(l, r, a) = list(map(int, input().split()))
result = 0
if l <= r:
	(l, r) = (r, l)
result += r
l -= r
if a >= l:
	result += l + floor((a - l) / 2)
else:
	result += a
print(2 * result)


num = [int(i) for i in input().split()]
while num[0] != num[1] and num[2] != 0:
	if num[1] > num[0]:
		num[2] = num[2] - 1
		num[0] = num[0] + 1
	else:
		num[2] = num[2] - 1
		num[1] = num[1] + 1
if num[0] == num[1]:
	if num[2] % 2 == 0:
		print(int(sum(num)))
	else:
		print(int(sum(num) - 1))
elif num[1] > num[0]:
	print(int(num[0] * 2))
else:
	print(int(num[1] * 2))


flag = 0
l = ''
r = ''
a = ''
team = input('')
for n in team:
	if flag == 0:
		if n != ' ':
			l = l + n
		else:
			flag = 1
	elif flag == 1:
		if n != ' ':
			r = r + n
		else:
			flag = 2
	else:
		a = a + n
l = int(l)
r = int(r)
a = int(a)
if a == 0:
	if l != r:
		if r != 0 and l != 0:
			if l < r:
				print(l * 2)
			else:
				print(r * 2)
		else:
			print(0)
	else:
		print(l + r)
elif abs(l - r) > a and r != l:
	if l < r:
		l = l + a
		print(l * 2)
	else:
		r = r + a
		print(r * 2)
else:
	if r != l:
		if l < r:
			a = a - (r - l)
			l = r
		else:
			a = a - (l - r)
			r = l
	if a % 2 == 0:
		l = l + int(a / 2)
		r = r + int(a / 2)
		a = 0
	else:
		l = l + int((a - 1) / 2)
		r = r + int((a - 1) / 2)
		a = 1
	print(l * 2)


import math
import sys
import string

def ri():
	return input()

def ii():
	return int(input())

def li():
	return input().split()

def mi():
	return list(map(int, input().split()))
(l, r, a) = mi()
if r != l:
	if a >= abs(l - r):
		a -= abs(l - r)
		if l > r:
			r = l
		else:
			l = r
	else:
		if l > r:
			r += a
		else:
			l += a
		a = 0
l += a // 2
r += a // 2
print(min(l, r) * 2)


(l, r, a) = map(int, input().split())
(total, m, ma) = (0, 0, 0)
if l == 0 and a == 0 or (r == 0 and a == 0):
	total = 0
elif min(l, r) + a < max(l, r):
	total = (min(l, r) + a) * 2
else:
	total = (l + a + r) // 2 * 2
print(total)


(n, m, k) = map(int, input().split())
if n > m:
	(n, m) = (m, n)
if k >= m - n:
	print(m * 2 + (k - (m - n)) - (k - m + n) % 2)
elif k < m - n:
	print((n + k) * 2)
else:
	print('0')


(l, r, a) = [int(i) for i in input().split()]
if l < r:
	(l, r) = (r, l)
c = l - r
if c <= a:
	a = a - c
	print((a // 2 + l) * 2)
else:
	print((a + r) * 2)


l = list(map(int, input().split()))
x = l[0]
y = l[1]
z = l[2]
if x > y + z or y > x + z:
	print(2 * (sum(l) - max(l)))
elif x == 0 and z == 0 or (y == 0 and z == 0):
	print(0)
elif (x + y + z) % 2 == 1:
	print(x + y + z - 1)
else:
	print(x + y + z)


(a, b, c) = map(int, input().split())
(a, b) = (min(a, b), abs(a - b))
d = min(b, c)
print(2 * a + 2 * d + (c - d) // 2 * 2)


(l, r, a) = map(int, input().split())
if abs(l - r) < a:
	print(l + r + a & ~1)
else:
	print(2 * (min(l, r) + a))


(l, r, a) = map(int, input().split())
temp = 2 * min(l, r)
temp1 = max(l, r) - min(l, r)
if temp1 <= a:
	print(temp + 2 * temp1 + (a - temp1) // 2 * 2)
else:
	print(temp + 2 * a)


(l, r, a) = [int(c) for c in input().split(' ')]
(lt, rt) = (l, r)
if l < r:
	if abs(r - l) < a:
		print(2 * r + (a - (r - l)) // 2 * 2)
	else:
		print(2 * (l + a))
elif abs(l - r) < a:
	print(2 * l + (a - (l - r)) // 2 * 2)
else:
	print(2 * (r + a))


(l, r, a) = map(int, input().split())
(min1, max1) = (min(l, r), max(l, r))
max1 -= min1
min1 *= 2
if a <= max1:
	print(min1 + a * 2)
else:
	print(min1 + (a + max1) // 2 * 2)


(l, r, a) = map(int, input().split())
k = max(l, r)
h = min(l, r)
if k == h:
	print(2 * l + 2 * (a // 2))
elif h + a <= k:
	print(2 * (h + a))
else:
	print(2 * k + 2 * ((h + a - k) // 2))


(l, r, a) = map(int, input().split())
while a != 0:
	if min(l, r) == l:
		l += 1
	else:
		r += 1
	a -= 1
print(min(l, r) * 2)


(l, r, a) = map(int, input().split())
x = 0
if l == r:
	if a % 2 == 0:
		x = l + r + a
	else:
		x = l + r + a // 2 * 2
elif l < r and a > 0:
	while a and l < r:
		l = l + 1
		a = a - 1
	if a > 0 and l == r:
		if a % 2 == 0:
			x = l + r + a
		else:
			x = l + r + a // 2 * 2
	elif a == 0:
		x = min(l, r)
		x = x * 2
elif r < l and a > 0:
	while a and r < l:
		r = r + 1
		a = a - 1
	if a > 0 and l == r:
		if a % 2 == 0:
			x = l + r + a
		else:
			x = l + r + a // 2 * 2
	elif a == 0:
		x = min(l, r)
		x = x * 2
elif a == 0 and (l < r or r < l):
	x = min(l, r)
	x = x * 2
print(x)


TN = 1

def solution():
	(l, r, a) = map(int, input().split())
	ans = 0
	while True:
		if l == r:
			ans = 2 * l + a // 2 * 2
			break
		elif l > r:
			if a + r >= l:
				ans = 2 * l + (a - l + r) // 2 * 2
				break
			l -= 1
		else:
			if a + l >= r:
				ans = 2 * r + (a - r + l) // 2 * 2
				break
			r -= 1
	print(ans)
while TN != 0:
	solution()
	TN -= 1


(l, r, a) = map(int, input().split())
(l, r) = (min(l, r), max(l, r))
m = min(r - l, a)
l += m
a -= m
l += a // 2
print(2 * l)


(l, r, a) = input().split(' ')
l = int(l)
r = int(r)
a = int(a)
ans = 0
r1 = r
l1 = l
a1 = a
if l >= r:
	while r != 0:
		ans += 1
		r -= 1
	ans = ans * 2
	l -= r1
	if l >= a:
		ans += 2 * a
	else:
		ans += 2 * l
		a -= l
		if a % 2 == 0:
			ans += a
		else:
			ans += a - 1
else:
	while l != 0:
		ans += 1
		l -= 1
	ans = ans * 2
	r -= l1
	if r >= a:
		ans += 2 * a
	else:
		ans += 2 * r
		a -= r
		if a % 2 == 0:
			ans += a
		else:
			ans += a - 1
print(ans)


(l, r, a) = map(int, input().split())
if l == r:
	if a % 2 == 0:
		print(l + r + a)
	else:
		print(l + r + a - 1)
	exit()
(m, M) = (min(l, r), max(l, r))
(ans, M) = (2 * m, M - m)
if M == a:
	print(ans + M + a)
	exit()
elif a < M:
	print(ans + a + a)
	exit()
elif a > M:
	(ans, a) = (ans + M * 2, a - M)
	if a % 2 == 0:
		print(ans + a)
	else:
		print(ans + a - 1)


(l, r, a) = map(int, input().split())
print(min(min((l + r + a) // 2, l + a), r + a) * 2)


(l, r, a) = map(int, input().split())
cnt = 0
while True:
	if l > 0 and r > 0:
		l -= 1
		r -= 1
		cnt += 1
		continue
	if a > 0 and r > 0:
		a -= 1
		r -= 1
		cnt += 1
		continue
	if a > 0 and l > 0:
		a -= 1
		l -= 1
		cnt += 1
		continue
	if a >= 2:
		a -= 2
		cnt += 1
		continue
	break
print(2 * cnt)


(l, r, a) = map(int, input().split())
if r > l:
	(l, r) = (r, l)
if l == r:
	print(2 * (l + a // 2))
elif l == 0 and r == 0:
	print(2 * a // 2)
elif l == 0:
	if r == a:
		print(2 * a)
	elif r > a:
		print(2 * a)
	else:
		print(2 * ((r + a) // 2))
elif r == 0:
	if l == a:
		print(2 * a)
	elif l > a:
		print(2 * a)
	else:
		print(2 * ((l + a) // 2))
elif r + a <= l:
	print(2 * (r + a))
else:
	print(2 * ((l + r + a) // 2))


s = [int(a) for a in input().split()]
if s[0] > s[1]:
	(s[0], s[1]) = (s[1], s[0])
diff = s[1] - s[0]
if diff <= s[2]:
	s[2] -= diff
	s[0] += diff
	s[0] += s[2] // 2
	s[1] += s[2] // 2
else:
	s[0] += s[2]
print(2 * min(s[0], s[1]))


w = list(map(int, input().split()))
l = w[0]
r = w[1]
a = w[2]
if l > r:
	if a >= l - r:
		a -= l - r
		r = l
	else:
		r += a
		l = r
		a = 0
elif r > l:
	if a >= r - l:
		a -= r - l
		l = r
	else:
		l += a
		r = l
		a = 0
if l == r:
	print((l + a // 2) * 2)


(l, r, a) = map(int, input().split())
ans = min(l, r)
ans += min(a, abs(l - r))
a -= min(a, abs(l - r))
ans += a // 2
print(2 * ans)


x = input().split()
l = int(x[0])
r = int(x[1])
a = int(x[2])
for i in range(a):
	if l <= r:
		l = l + 1
	else:
		r = r + 1
if l < r:
	print(2 * l)
elif r <= l:
	print(2 * r)


(a, b, c) = map(int, input().split())
if a + c < b:
	print((a + c) * 2)
elif b + c < a:
	print((b + c) * 2)
else:
	print((a + b + c) // 2 * 2)


from math import *
(a, b, c) = map(int, input().split())
p = min(a, b)
k = max(a, b)
s = k - p
if s >= c:
	ans = 2 * (p + c)
else:
	ans = 2 * (k + (c - s) // 2)
print(ans)


(l, r, a) = list(map(int, input().split()))
if l < r:
	mymin = l
	mymax = r
else:
	mymin = r
	mymax = l
s = mymax - mymin
if a >= s:
	print(mymax * 2 + (a - s) // 2 * 2)
else:
	print((mymin + a) * 2)


(r1, l1, rl) = map(int, input().split())
if r1 == l1:
	print(r1 + l1 + rl // 2 * 2)
elif r1 > l1:
	if rl >= abs(r1 - l1):
		print(2 * r1 + 2 * ((rl - abs(r1 - l1)) // 2))
	else:
		print((l1 + rl) * 2)
elif rl >= abs(l1 - r1):
	print(2 * l1 + 2 * ((rl - abs(l1 - r1)) // 2))
else:
	print((r1 + rl) * 2)


import sys

def main(args):
	(l, r, a) = map(int, input().split())
	(m, x) = (max(l, r), min(a, abs(l - r)))
	(a, l, r) = (a - x, min(m, l + x), min(m, r + x))
	(l, r) = (l + a // 2, r + a // 2)
	print(min(l, r) * 2)
sys.exit(main(sys.argv))


(l, r, a) = map(int, input().split())
k = min(l, r)
if k + a == max(l, r):
	print(2 * (k + a))
elif k + a > max(l, r) and k != 0:
	c = a - (max(l, r) - k)
	c = c // 2
	print(2 * (max(l, r) + c))
elif min(l, r) == 0:
	if max(l, r) > a:
		print(a)
	else:
		print(2 * (max(l, r) + (a - max(l, r)) // 2))
elif k + a < max(l, r) and k != 0:
	print(2 * (k + a))


(l, r, a) = input().split()
l = int(l)
r = int(r)
a = int(a)
maxi = 0
for i in range(a + 1):
	t1 = l + i
	t2 = r + a - i
	if t1 < t2:
		mini = t1
	else:
		mini = t2
	if maxi < mini:
		maxi = mini
print(maxi << 1)


import math
(l, r, a) = (int(x) for x in input().split())
if (l == 0 and r == 0) and a != 0:
	print(a // 2 * 2)
elif l == 0 and a == 0 or (r == 0 and a == 0):
	print(0)
elif a == 0:
	print(min(l, r) * 2)
elif l > r:
	razn = l - r
	if razn > a:
		r += a
		print(int(r) * 2)
	elif razn < a:
		r += razn
		a -= razn
		r += a // 2
		print(int(r) * 2)
	elif razn == a:
		r += razn
		print(int(r) * 2)
elif r > l:
	razn = r - l
	if razn > a:
		l += a
		print(int(l) * 2)
	elif razn < a:
		l += razn
		a -= razn
		l += a // 2
		print(l * 2)
	elif razn == a:
		l += razn
		print(int(l) * 2)
else:
	l += a // 2
	print(int(l) * 2)


from sys import stdin
(l, r, a) = map(int, stdin.readline().split())
if l == r:
	l += a // 2
	r += a // 2
elif l < r:
	while l < r and a > 0:
		l += 1
		a -= 1
	l += a // 2
	r += a // 2
else:
	while r < l and a > 0:
		r += 1
		a -= 1
	l += a // 2
	r += a // 2
print(min(l, r) * 2)


(li, r, a) = list(map(int, input().split()))
pla = 0
if li < r:
	pla += li + li
	if r - li == a:
		pla += r - li + r - li
	elif r - li < a:
		pla += r - li + r - li
		if (a - r + li) % 2 == 0:
			pla += a - r + li
		else:
			pla += a - r + li - 1
	elif r - li > a:
		pla += a + a
elif li > r:
	pla += r + r
	if li - r == a:
		pla += li - r + li - r
	elif li - r < a:
		pla += (li - r) * 2
		if (a - li + r) % 2 == 0:
			pla += a + r - li
		else:
			pla += a + r - li - 1
	elif li - r > a:
		pla += a + a
elif li == r:
	pla += li + li
	if a % 2 == 0:
		pla += a
	elif a % 2 != 0:
		pla += a - 1
print(pla)


k = input().split()
l = int(k[0])
r = int(k[1])
a = int(k[2])
maxh = max(l, r)
minh = min(l, r)
if minh + a < maxh:
	print((minh + a) * 2)
else:
	a -= maxh - minh
	print(maxh * 2 + a // 2 * 2)


(l, r, a) = [int(x) for x in input().split()]
max_num = max(l, r)
min_num = min(l, r)
diff = abs(max_num - min_num)
if a <= diff:
	print((min_num + a) * 2)
else:
	left_over = min_num + a - max_num
	add_both_sides = left_over // 2
	print(max_num * 2 + add_both_sides * 2)


import sys
if len(sys.argv) > 1 and sys.argv[1] == 'SCHULLZ':
	str = open('file.in').read()
else:
	str = input()
ss = str.split()
l = int(ss[0])
r = int(ss[1])
a = int(ss[2])
if l > r:
	tmp = l
	l = r
	r = tmp
dl = r - l
if dl > a:
	dl = a
l += dl
a -= dl
a = a // 2
l += a
r += a
l = min(l, r)
r = min(l, r)
print(l + r)


x = input().split()
l = int(x[0])
r = int(x[1])
a = int(x[2])
if l > r:
	(l, r) = (r, l)
temp = r - l
if temp <= a:
	a -= temp
	ans = r + a // 2
else:
	ans = l + a
print(ans * 2)


(l, r, a) = map(int, input().split())
d = min(abs(r - l), a)
a -= d
print((min(l, r) + d + a // 2) * 2)


arr = list(map(int, input().strip().split(' ')))
l = min(arr[0], arr[1])
r = max(arr[0], arr[1])
a = arr[2]
ans = 2 * l
r = r - l
if a > r:
	ans = ans + 2 * r + (a - r) // 2 * 2
else:
	ans = ans + 2 * a
print(ans)


(l, r, a) = list(map(int, input().split()))
if l == r:
	print(l + r + a // 2 + a // 2)
elif a == 0:
	print(min(l, r) * 2)
else:
	mi = min(l, r)
	ma = max(l, r)
	k = ma - mi
	if a >= k:
		mi = mi + k
		a -= k
		print(mi + ma + a // 2 + a // 2)
	else:
		mi = mi + a
		print(mi + mi)


(lHand, rHand, ambidexter) = map(int, input().split())
if lHand == 0 and ambidexter == 0 or (rHand == 0 and ambidexter == 0):
	print(0)
elif lHand > rHand:
	diff = lHand - rHand
	if diff > ambidexter:
		print(2 * (rHand + ambidexter))
	else:
		print(2 * (rHand + diff + (ambidexter - diff) // 2))
elif lHand == rHand:
	print(2 * (lHand + ambidexter // 2))
else:
	diff = rHand - lHand
	if diff > ambidexter:
		print(2 * (lHand + ambidexter))
	else:
		print(2 * (lHand + diff + (ambidexter - diff) // 2))


import math
from decimal import Decimal

def na():
	n = int(input())
	b = [int(x) for x in input().split()]
	return (n, b)

def nab():
	n = int(input())
	b = [int(x) for x in input().split()]
	c = [int(x) for x in input().split()]
	return (n, b, c)

def dv():
	(n, m) = map(int, input().split())
	return (n, m)

def dva():
	(n, m) = map(int, input().split())
	a = [int(x) for x in input().split()]
	b = [int(x) for x in input().split()]
	return (n, m, b)

def eratosthenes(n):
	sieve = list(range(n + 1))
	for i in sieve:
		if i > 1:
			for j in range(i + i, len(sieve), i):
				sieve[j] = 0
	return sorted(set(sieve))

def nm():
	n = int(input())
	b = [int(x) for x in input().split()]
	m = int(input())
	c = [int(x) for x in input().split()]
	return (n, b, m, c)

def dvs():
	n = int(input())
	m = int(input())
	return (n, m)
(n, m, k) = map(int, input().split())
if n < m:
	if n + k >= m:
		k -= m - n
		n = m
		k //= 2
		print((n + k) * 2)
	if n + k < m:
		n += k
		print(n * 2)
else:
	if m + k >= n:
		k -= n - m
		m = n
		k //= 2
		print((m + k) * 2)
	if m + k < n:
		m += k
		print(m * 2)


(l, r, a) = [int(i) for i in input().split(' ')]
while a > 0:
	if l > r:
		r += 1
	else:
		l += 1
	a -= 1
print(2 * min(l, r))


(l, r, a) = [int(i) for i in input().split()]
if l > r:
	(l, r) = (r, l)
while a > 0 and (l < r or r == l):
	a -= 1
	l += 1
	if l > r:
		(l, r) = (r, l)
print(2 * min(l, r))


(a, b, c) = map(int, input().split())
cnt = 0
for i in range(c):
	if a > b:
		b += 1
	else:
		a += 1
print(2 * min(a, b))


(a, b, c) = map(int, input().split())
print([(a + b + c) // 2 * 2, (min(a, b) + c) * 2][min(a, b) + c <= max(a, b)])


import sys

class MyReader:

	def __init__(self):
		filename = 'file.in'
		if len(sys.argv) > 1 and sys.argv[1] == 'SCHULLZ':
			self.file = open(filename)
		self.str = ['']
		self.ind = 1

	def nextString(self):
		if len(sys.argv) > 1 and sys.argv[1] == 'SCHULLZ':
			return self.file.read()
		else:
			return input()

	def nextInt(self):
		return int(self.nextToken())

	def nextToken(self):
		if self.ind >= len(self.str):
			self.ind = 0
			self.str = self.nextString().split()
		self.ind += 1
		return self.str[self.ind - 1]
rdr = MyReader()
l = rdr.nextInt()
r = rdr.nextInt()
a = rdr.nextInt()
if l > r:
	(l, r) = (r, l)
dl = r - l
if dl > a:
	dl = a
l += dl
a -= dl
a = a // 2
l += a
r += a
l = min(l, r)
r = min(l, r)
print(l + r)


(l, r, a) = map(int, input().split())
if l == r:
	print(l + r + 2 * (a // 2))
else:
	k = min(l, r)
	j = max(l, r)
	while k != j and a != 0:
		k += 1
		a -= 1
	print(2 * k + 2 * (a // 2))


(l, r, a) = map(int, input().split())
(l, r) = (min(l, r), max(l, r))
b = r - l
if b <= a:
	a -= b
	print((r + a // 2) * 2)
else:
	print((l + a) * 2)


giris = input()
ayirilmisInput = giris.split(' ')
l = int(ayirilmisInput[0])
r = int(ayirilmisInput[1])
a = int(ayirilmisInput[2])
fark = l - r
while a > 0:
	a -= 1
	if l < r:
		l += 1
	else:
		r += 1
kucukOlan = min(l, r)
print(kucukOlan * 2)


(L, R, A) = map(int, input().split())
if L <= R:
	if A < R - L:
		print(2 * (L + A))
	else:
		A -= R - L
		print(2 * (R + A // 2))
elif A < L - R:
	print(2 * (R + A))
else:
	A -= L - R
	print(2 * (L + A // 2))


(l, r, a) = (int(x) for x in input().split())
less = min(l, r)
more = max(l, r)
while less < more and a > 0:
	less += 1
	a -= 1
rest = a // 2
print(2 * (less + rest))


(l, r, a) = list(map(int, input().split()))
if l > r:
	(l, r) = (r, l)
if l + a <= r:
	print((l + a) * 2)
else:
	print((a + l + r) // 2 * 2)


(l, r, a) = map(int, input().split())
m = min(l, r)
v = l + r - m
d = v - m
print([m + a, v + (a - d) // 2][a > d] * 2)


(l, r, a) = map(int, input().split())
if l >= r:
	n = r * 2
	l -= n // 2
	while l != 0 and a != 0:
		n += 2
		l -= 1
		a = a - 1
	if a != 0:
		n += a // 2 * 2
else:
	n = l * 2
	r -= n // 2
	while r != 0 and a != 0:
		n += 2
		r -= 1
		a = a - 1
	if a != 0:
		n += a // 2 * 2
print(n)


(l, r, a) = map(int, input().split())
m = min(l, r)
s = l + r - m
n = s - m
print([m + a, s + (a - n) // 2][a > n] * 2)


(l, r, a) = [int(x) for x in input().split()]
if l > r:
	t = 2 * r
	x = l - r
else:
	t = 2 * l
	x = r - l
if a > x:
	t = t + 2 * x
	z = a - x
	y = z // 2 * 2
	t = t + y
else:
	t = t + 2 * a
print(t)


import io, os
(l, r, a) = map(int, input().split())
if l > r:
	(l, r) = (r, l)
temp = min(r - l, a)
l += temp
a = a - temp
l = l + a // 2
print(l * 2)


(l, r, a) = [int(i) for i in input().split()]
b = max(l, r)
c = min(l, r)
d = b - c
if d >= a:
	print(2 * (c + a))
elif a > d:
	e = a - d
	f = e // 2
	print(2 * (b + f))


(l, r, a) = list(map(int, input().split()))
(small, big) = sorted((l, r))
if big - small > a:
	print(2 * (small + a))
else:
	a -= big - small
	print(2 * (big + a // 2))


(a, b, c) = map(int, input().split())
z = min(a, b)
y = max(a, b)
if z + c < y:
	print(2 * (z + c))
elif z + c == y:
	print(2 * (z + c))
elif z == y:
	x = c // 2
	print(2 * (z + x))
elif c != 0:
	flag = 0
	while c != 0:
		if z < y:
			z = z + 1
		elif y < z:
			y = y + 1
		else:
			c = c // 2
			z = z + c
			flag = 1
			break
		c -= 1
	if flag == 1:
		print(2 * z)
	else:
		print(2 * min(z, y))
else:
	print(2 * min(z, y))


(l, r, a) = map(int, input().split())
mi = min(l, r)
ma = max(l, r)
us = min(ma - mi, a)
ot = a - us >> 1
re = mi + us + ot
print(2 * re)


(l, r, a) = map(int, input().split())
x = a
if l < r:
	min = l
	max = r
else:
	min = r
	max = l
for i in range(0, a):
	if x == 0:
		break
	if min == max:
		break
	min += 1
	x -= 1
	if x == 0:
		break
	if min == max:
		break
team = min * 2
if x % 2 == 0:
	team += x
else:
	team += x - 1
print(team)


t = input()
(n, m, l) = [int(i) for i in t.split(' ')]
if n + l <= m:
	print(2 * (n + l))
elif m + l <= n:
	print(2 * (m + l))
elif (n + m + l) % 2 == 0:
	print(n + m + l)
else:
	print(n + m + l - 1)


def comand(l, r, a):
	while True:
		if a == 0:
			break
		if l < r:
			(l, a) = (l + 1, a - 1)
		else:
			(r, a) = (r + 1, a - 1)
	return 2 * min(l, r)
(L, R, A) = [int(i) for i in input().split()]
print(comand(L, R, A))


from sys import stdin, stdout

def main():
	(l, r, a) = tuple([int(i) for i in stdin.readline().split()])
	count = min(l, r)
	l -= count
	r -= count
	if r != 0:
		newval = min(r, a)
		count += newval
		r -= newval
		a -= newval
	elif l != 0:
		newval = min(l, a)
		count += newval
		l -= newval
		a -= newval
	if a != 0:
		count += a // 2
	stdout.write(str(count * 2))
main()


x = list(map(int, input().split()))
if x[2] == 0 or 1:
	if x[0] < x[1]:
		answer = x[0] * 2
	else:
		answer = x[1] * 2
while x[2] >= 1:
	if x[0] < x[1]:
		x[0] = x[0] + 1
		x[2] = x[2] - 1
		answer = x[0] * 2
	elif x[1] < x[0]:
		x[1] += 1
		x[2] -= 1
		answer = x[1] * 2
	elif x[2] == 1:
		x[2] = 0
	elif x[0] == x[1] and x[2] != 1:
		x[0] += 1
		x[1] += 1
		x[2] -= 2
		answer = x[1] * 2
if x[0] == 0 or x[1] == 0:
	answer = 0
print(answer)


(l, r, a) = map(int, input().split())
Max = max(l, r)
Min = min(l, r)
if Min + a <= Max:
	print(2 * (Min + a))
else:
	print((Max + (Min + a - Max) // 2) * 2)


(l, r, a) = map(int, input().split())
for _ in range(a):
	if l < r:
		l += 1
	else:
		r += 1
print(min(l, r) * 2)


(a, b, c) = input().split()
a = int(a)
b = int(b)
c = int(c)
w1 = 0
w2 = 0
for i in range(c):
	if a >= b:
		b += 1
	else:
		a += 1
	c -= 1
if a > b:
	a = b
else:
	b = a
print(a * 2)


li = list(map(int, input().split()))
while li[2]:
	if li[0] < li[1]:
		li[0] += 1
	else:
		li[1] += 1
	li[2] -= 1
print(min(li[0], li[1]) * 2)


inp = input().split(' ')
l = int(inp[0])
r = int(inp[1])
a = int(inp[2])
print((min(l, r) + min(a, max(l, r) - min(l, r)) + int(max(0, a - max(l, r) + min(l, r)) / 2)) * 2)


(l, r, a) = [int(k) for k in input().split(' ') if k]
lh = l
rh = r
if lh < rh:
	add = min(rh - lh, a)
	lh += add
	a -= add
elif rh < lh:
	add = min(lh - rh, a)
	rh += add
	a -= add
if a > 0:
	lh += a // 2
	rh += a // 2
print(2 * min(lh, rh))


print((lambda l, r, a: 2 * max((min(l + i, r + a - i) for i in range(a + 1))))(*map(int, input().split())))


def solution(l1):
	left = l1[0]
	right = l1[1]
	ambi = l1[2]
	stage1 = min(left, right)
	stage2 = min(ambi, max(left, right) - stage1)
	stage3 = int((ambi - stage2) / 2)
	ans = 2 * (stage1 + stage2 + stage3)
	return ans

def answer():
	l1 = [int(x) for x in input().split()]
	print(solution(l1))
answer()


(l, r, b) = map(int, input().split())
if r > l:
	a = min(b, r - l)
	l += a
	b -= a
elif l > r:
	a = min(b, l - r)
	r += a
	b -= a
if b % 2:
	l += b // 2
	r += b // 2 + 1
else:
	l += b // 2
	r += b // 2
print(min(l, r) * 2)


import sys
if len(sys.argv) > 1 and sys.argv[1] == 'SCHULLZ':
	print('!!!')
str = input()
ss = str.split()
l = int(ss[0])
r = int(ss[1])
a = int(ss[2])
if l > r:
	tmp = l
	l = r
	r = tmp
dl = r - l
if dl > a:
	dl = a
l += dl
a -= dl
a = a // 2
l += a
r += a
l = min(l, r)
r = min(l, r)
print(l + r)


(l, r, a) = [int(l) for l in input().split()]
if r > l:
	b = r - l
	if b >= a:
		c = b - a
		n = l + a + (r - c)
	if b < a:
		c = a - b
		if c % 2 == 0:
			n = l + r + c + b
		else:
			n = l + r + b + c - 1
elif l > r:
	b = l - r
	if b >= a:
		c = b - a
		n = r + a + (l - c)
	if b < a:
		c = a - b
		if c % 2 == 0:
			n = l + r + c + b
		else:
			n = l + r + b + c - 1
elif l == r:
	if a % 2 == 0:
		n = l + r + a
	else:
		n = l + r + a - 1
print(n)


(l, r, a) = list(map(int, input().split()))
best = 0
for l1 in range(l + 1):
	for r1 in range(r + 1):
		diff = abs(l1 - r1)
		if diff <= a:
			cur_ans = max(l1, r1) * 2 + (a - diff) // 2 * 2
			best = max(cur_ans, best)
print(best)


(l, r, a) = map(int, input().split())
if l == 0 and r == 0 and (a == 0):
	print(0)
	exit()
for i in range(a):
	if l == min(l, r):
		l += 1
	else:
		r += 1
print(min(l, r) * 2)


(l, r, a) = map(int, input().split())
while True:
	if l == r and a >= 2:
		l += int(a / 2)
		r += int(a / 2)
		a = a % 2
	elif r > l:
		if a >= r - l:
			a -= r - l
			l += r - l
		else:
			l += a
			a -= a
			break
	elif l > r:
		if a >= l - r:
			a -= l - r
			r += l - r
		else:
			r += a
			a -= a
			break
	else:
		break
if l == 0 or r == 0:
	print(0)
else:
	print(min(r, l) * 2)


(L, R, A) = [int(x) for x in input().strip().split(' ')]
if L > R:
	(L, R) = (R, L)
d = R - L
L += min(A, d)
A -= min(A, d)
A -= A % 2
L += int(A / 2)
print(L * 2)


(l, r, a) = map(int, input().split())
c = abs(r - l)
sum = 0
if c > a:
	d = c - a
	sum = l + r - d + a
else:
	sum = l + r + c
	a -= c
	sum += a
	if sum % 2 != 0:
		sum -= 1
print(sum)


(l, r, a) = map(int, input().split())
if l > r and a >= l - r:
	a -= l - r
	r = l
elif l > r and a < l - r:
	r += a
	l = r
	print(l + r)
	exit()
elif l < r and a >= r - l:
	a -= r - l
	l = r
elif l < r and a < r - l:
	l += a
	r = l
	print(l + r)
	exit()
print(l + r + (a - a % 2))


(l, r, a) = map(int, input().split())
(x, y) = (min(l, r), max(l, r))
y -= x
if y >= a:
	print((x + a) * 2)
else:
	a -= y
	print((x + y + a // 2) * 2)


(l, r, a) = [int(s) for s in input().split(' ')]
if l > r:
	(l, r) = (r, l)
ans = 0
if l + a <= r:
	ans += (l + a) * 2
else:
	ans += r * 2
	ans += (l + a - r) // 2 * 2
print(ans)


(l, r, a) = map(int, input().split())
ans = min(l, r)
l -= ans
r -= ans
tmp = min(max(l, r), a)
a -= tmp
ans += tmp
ans += a // 2
print(ans * 2)


(l, r, a) = input().split()
(l, r, a) = [int(l), int(r), int(a)]
if l == 0 and a == 0:
	print(0)
elif r == 0 and a == 0:
	print(0)
elif l > r:
	x = l - r
	if x >= a:
		print((a + r) * 2)
	else:
		y = a - x
		print((l + int(y / 2)) * 2)
elif r > l:
	x = r - l
	if x >= a:
		print((a + l) * 2)
	else:
		y = a - x
		print((r + int(y / 2)) * 2)
else:
	print((l + int(a / 2)) * 2)


(l, r, a) = map(int, input().split())
if r - l >= a:
	ans = 2 * (l + a)
elif l - r >= a:
	ans = 2 * (r + a)
elif (l + r + a) % 2 == 0:
	ans = l + r + a
else:
	ans = l + r + a - 1
print(ans)


n = list(map(int, input().split()))
l = max(n[0], n[1])
r = min(n[0], n[1])
a = n[2]
if l > r:
	if l - r >= a:
		r += a
		print(r * 2)
	elif l - r < a:
		a -= l - r
		r += l - r
		if a % 2 == 0:
			print(l * 2 + a)
		elif a % 2 != 0:
			print(l * 2 + a - 1)
elif l == r:
	if a % 2 == 0:
		print(l * 2 + a)
	elif a % 2 != 0:
		print(l * 2 + a - 1)


(l, r, a) = [int(x) for x in input().split()]
ans = min(l, r)
l -= ans
r -= ans
tmp = max(l, r)
ans2 = min(a, tmp)
a -= ans2
tmp -= ans2
ans3 = a // 2
print((ans + ans2 + ans3) * 2)


(l, r, a) = map(int, input().split())
if l > r + a:
	print(2 * (r + a))
elif r > l + a:
	print(2 * (l + a))
else:
	print(2 * max(l, r) + 2 * ((a - abs(r - l)) // 2))


(l, r, a) = map(int, input().split())
mx = 0
for i in range(a + 1):
	x = r + i
	y = l + a - i
	mx = max(mx, min(x, y) * 2)
print(mx)


s = input().split()
(l, r, a) = (int(s[0]), int(s[1]), int(s[2]))
if l == r:
	print((l + a // 2) * 2)
elif max(l, r) - min(l, r) >= a:
	print((min(l, r) + a) * 2)
elif max(l, r) - min(l, r) < a:
	print(max(l, r) * 2 + (a - max(l, r) + min(l, r)) // 2 * 2)


(l, r, a) = map(int, input().split())
if l == r:
	x = int(l + a / 2) * 2
	print(x)
elif l < r:
	if r - l > a:
		print((l + a) * 2)
	else:
		a = a - (r - l)
		l = r
		x = int(l + a / 2) * 2
		print(x)
elif l - r > a:
	print((r + a) * 2)
else:
	a = a - (l - r)
	r = l
	x = int(l + a / 2) * 2
	print(x)


s = [int(n) for n in input().split()]
m = 0
if s[1] == s[0]:
	m = 2 * s[0]
	if s[2] >= 2:
		m += 2 * (s[2] // 2)
elif s[1] > s[0]:
	k = s[0] + s[2]
	if k == s[1]:
		m = 2 * k
	elif k > s[1]:
		d = k - s[1]
		m = 2 * s[1]
		if d >= 2:
			m = m + 2 * (d // 2)
	elif k < s[1]:
		d = s[1] - k
		m = 2 * k
elif s[0] > s[1]:
	k = s[1] + s[2]
	if k == s[0]:
		m = 2 * k
	elif k < s[0]:
		d = s[0] - k
		m = 2 * k
	elif k > s[0]:
		d = k - s[0]
		m = 2 * s[0]
		if d >= 2:
			m += 2 * (d // 2)
print(m)


(l, r, b) = map(int, input().strip().split()[:3])
if l == 0 and b == 0:
	print(0)
elif r == 0 and b == 0:
	print(0)
elif b == 0:
	print(min(l, r) * 2)
elif l > r:
	r = r + b
	if l >= r:
		print(min(l, r) * 2)
	else:
		k = r - l
		r = l
		if k % 2 == 0:
			print(l + r + k)
		else:
			print(l + r + k - 1)
elif r > l:
	l = l + b
	if r >= l:
		print(min(l, r) * 2)
	else:
		k = l - r
		l = r
		if k % 2 == 0:
			print(l + r + k)
		else:
			print(l + r + k - 1)
elif b % 2 == 0:
	print(l + r + b)
else:
	print(l + r + b - 1)


str_in = input()
num = [int(n) for n in str_in.split()]
a = num[0]
b = num[1]
c = num[2]
if a > b:
	d = a
	a = b
	b = d
if a + c <= b:
	print((a + c) * 2)
else:
	print(int((a + b + c) / 2) * 2)


(l, r, a) = [int(x) for x in input().split()]
diff = abs(l - r)
if a > diff:
	print((a - diff) // 2 * 2 + max(l, r) * 2)
else:
	print(min(l + a, r + a) * 2)


s = input().split(' ')
l = int(s[0])
r = int(s[1])
a = int(s[2])
deficit = abs(l - r)
low = min(l, r)
high = max(l, r)
if deficit >= a:
	print(2 * (low + a))
else:
	ans = 2 * high + (a - deficit)
	if ans % 2 == 0:
		print(ans)
	else:
		print(ans - 1)


list = [int(x) for x in input().split()]
while list[2] > 0:
	if list[0] < list[1]:
		list[0] += 1
	else:
		list[1] += 1
	list[2] -= 1
print(min(list[0:2]) * 2)


def oloko(lot):
	l = lot[0]
	r = lot[1]
	a = lot[2]
	o = True
	if (l == 0 or r == 0) and a == 0:
		return 0
	else:
		while o == True:
			if l < r and a >= 1:
				a -= 1
				l += 1
			elif r < l and a >= 1:
				a -= 1
				r += 1
			elif r == l and a >= 2:
				r += 1
				l += 1
				a -= 2
			elif l < r:
				r = l
			elif r < l:
				l = r
			else:
				o = False
	if r == l:
		return r + l
	else:
		return 0
lots = input().split()
lots = [int(lots[i]) for i in range(0, len(lots))]
print(oloko(lots))


(l, r, a) = map(int, input().split())
d = min(l, r) * 2
l -= d // 2
r -= d // 2
k = min(max(l, r), a)
d += k * 2
a -= k
print(d + a // 2 * 2)


import math

def main():
	string = input()
	arr = string.split(' ')
	leftHanders = int(arr[0])
	rightHander = int(arr[1])
	ambiDexters = int(arr[2])
	mini = min(leftHanders, rightHander)
	maxi = max(leftHanders, rightHander)
	if ambiDexters >= maxi - mini:
		ambiDexters -= maxi - mini
		mini = maxi
		mini += int(math.floor(ambiDexters / 2))
		print(mini * 2)
	else:
		mini += ambiDexters
		print(mini * 2)
main()


(l, r, a) = map(int, input().split())
p = min(l, r)
l -= p
r -= p
p1 = min(l, a)
l -= p1
a -= p1
p2 = min(r, a)
r -= p2
a -= p2
p3 = a // 2
print(2 * (p + p1 + p2 + p3))


(l, r, n) = map(int, input().split())
for i in range(n):
	if l < r:
		l += 1
	else:
		r += 1
print(2 * min(l, r))


(l, r, a) = map(int, input().split())
M = max(l, r)
m = min(l, r)
N = M - m
if N > a:
	m = m + a
	res = 2 * m
elif N < a:
	R = a - N
	m = m + N
	res = (m + R // 2) * 2
elif N == a:
	res = (m + a) * 2
print(res)


(l, r, a) = [int(x) for x in input().split()]
if l > r:
	(r, l) = (l, r)
print(2 * (l + a if l + a < r else (l + r + a) // 2))


(a, b, c) = list(map(int, input().split()))
if min(a, b) + c <= max(a, b):
	print((min(a, b) + c) * 2)
else:
	x = c - max(a, b) + min(a, b)
	print((max(a, b) + int(x / 2)) * 2)


(l, r, a) = [int(x) for x in input().split()]
if l >= r:
	p = l - r
	if p <= a:
		r = r + p
		a = a - p
	else:
		r = r + a
		l = r
		a = 0
if l < r:
	q = r - l
	if q <= a:
		l = l + q
		a = a - q
	else:
		l = l + a
		r = l
		a = 0
if a % 2 == 0:
	print(r + l + a)
if a % 2 != 0:
	print(r + l + (a - 1))


import math, itertools, fractions, heapq, collections, bisect, sys, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	(a, b, c) = LI()
	(a, b) = sorted([a, b])
	if b - a <= c:
		x = b - a
		a += x
		c -= x
		return a + b + c // 2 * 2
	else:
		a += c
		return a * 2
print(main())


import sys
(l, r, a) = (int(i) for i in input().split())
(res, max_) = (min(l, r) + a, max(l, r))
if res > max_:
	res = max_ + (res - max_) // 2
print(res * 2)


import math
(l, r, d) = map(int, input().split())
teamSize = 0
if l < r:
	if l + d == r:
		teamSize = l + r + d
	elif l + d < r:
		teamSize = 2 * (l + d)
	else:
		diff = r - l
		l += diff
		d -= diff
		teamSize = l + r + 2 * int(d / 2)
elif r < l:
	if r + d == l:
		teamSize = l + r + d
	elif r + d < l:
		teamSize = 2 * (r + d)
	else:
		diff = l - r
		r += diff
		d -= diff
		teamSize = l + r + 2 * int(d / 2)
else:
	teamSize = l + r + 2 * int(d / 2)
print(teamSize)


(l, r, a) = map(int, input().split())
if l == 0 and r == 0 and (a % 2 != 1):
	print(a)
elif l == r:
	deff = int(a / 2)
	print(l + r + deff * 2)
else:
	deff = abs(l - r)
	deff_value = abs(deff - a)
	if r > l:
		if deff > a:
			print(l + a + (r - deff_value))
		else:
			l = l + deff
			print(l + r + int(deff_value / 2) * 2)
	elif deff > a:
		print(l + a + (r - deff_value))
	else:
		r = r + deff
		print(l + r + int(deff_value / 2) * 2)


str = input()
ss = str.split()
l = int(ss[0])
r = int(ss[1])
a = int(ss[2])
if l > r:
	tmp = l
	l = r
	r = tmp
dl = r - l
if dl > a:
	dl = a
l += dl
a -= dl
a = a // 2
l += a
r += a
l = min(l, r)
r = min(l, r)
print(l + r)


(l, r, a) = list(map(int, input().split()))
if a == 0 and l == 0:
	print(0)
elif a == 0 and r == 0:
	print(0)
elif (l + r + a) % 2 == 0 and l == r:
	print(l + r + a)
elif l == r:
	print((l + a // 2) * 2)
elif l < r:
	if r - l <= a:
		t = r * 2
		if a - (r - l) > 1:
			t += (a - (r - l)) // 2 * 2
			print(t)
		else:
			print(t)
	elif r - l > a:
		print((l + a) * 2)
elif l - r <= a:
	t = 2 * l
	if a - (l - r) > 1:
		t += (a - (l - r)) // 2 * 2
		print(t)
	else:
		print(t)
elif l - r > a:
	print((r + a) * 2)


arr = input().split(' ')
l = int(arr[0])
r = int(arr[1])
a = int(arr[2])
if l < r:
	l += a
	if l <= r:
		print(2 * l)
	else:
		print(2 * r + (l - r) // 2 * 2)
else:
	r += a
	if r <= l:
		print(2 * r)
	else:
		print(2 * l + (r - l) // 2 * 2)


(l, r, a) = map(int, input().split())
n = min(r, l)
m = max(r, l)
if a == 0:
	z = 2 * n
	print(z)
else:
	y = a
	for i in range(0, a):
		if n == m:
			r = y // 2
			z = 2 * (n + r)
			break
		n = n + 1
		y = y - 1
		z = 2 * n
	print(z)


(l, r, a) = map(int, input().split())
mi = min(l, r)
ma = max(l, r)
while mi != ma and a != 0:
	mi = mi + 1
	a = a - 1
print(2 * mi + a // 2 * 2)


(l, r, a) = [int(i) for i in input().split()]
if l > r:
	team = r * 2
	x = l - r
else:
	team = l * 2
	x = r - l
if a > x:
	team = team + 2 * x
	z = a - x
	if (a - x) % 2 == 0:
		y = (a - x) // 2 * 2
	else:
		y = (a - x) // 2 * 2
	team = team + y
	print(team)
else:
	team = team + 2 * a
	print(team)


(l, r, a) = map(int, input().split())
if l == r:
	t = l * 2 + a // 2 * 2
elif l > r:
	z = l - r
	if a >= z:
		t = l * 2 + (a - z) // 2 * 2
	elif a < z:
		t = (r + a) * 2
elif r > l:
	z = r - l
	if a >= z:
		t = r * 2 + (a - z) // 2 * 2
	elif a < z:
		t = (l + a) * 2
print(t)


(l, r, a) = list(map(int, input().split()))
(M, m) = (max(l, r), min(l, r))
res = (m + a) * 2 if M - m >= a else 2 * M + (a + m - M) // 2 * 2
print(res)


(l, r, a) = [int(i) for i in input().split()]
maxN = max(l, r)
minN = min(l, r)
var = maxN - minN
if var >= a:
	print((minN + a) * 2)
else:
	print(2 * (maxN + int((a - var) / 2)))


class CodeforcesTask950ASolution:

	def __init__(self):
		self.result = ''
		self.l_r_a = []

	def read_input(self):
		self.l_r_a = [int(x) for x in input().split(' ')]

	def process_task(self):
		size = min(self.l_r_a[0], self.l_r_a[1])
		rl = self.l_r_a[0] - size
		rl += self.l_r_a[1] - size
		size *= 2
		if rl:
			if self.l_r_a[2] > rl:
				size += rl * 2
				remain = self.l_r_a[2] - rl
				size += remain // 2 * 2
			else:
				size += self.l_r_a[2] * 2
		else:
			size += self.l_r_a[2] // 2 * 2
		self.result = str(size)

	def get_result(self):
		return self.result
Solution = CodeforcesTask950ASolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


(l, r, a) = list(map(int, input().split()))
sum = 2 * min(l, r)
dif = abs(l - r)
if dif >= a:
	sum += 2 * a
else:
	sum += dif + a
if sum % 2 == 1:
	sum -= 1
print(sum)


(x, y, z) = map(int, input().split())
if x == y:
	if z % 2 == 0:
		total = x + y + z
		print(total)
	else:
		total = x + y + (z - 1)
		print(total)
elif x < y:
	add = x + z
	if add > y:
		total = add - y
		if total % 2 == 0:
			print(x + y + z)
		else:
			print(x + y + (z - 1))
	else:
		print(2 * add)
else:
	add = y + z
	if add > x:
		total = add - x
		if total % 2 == 0:
			print(x + y + z)
		else:
			print(x + y + (z - 1))
	else:
		print(2 * add)


inp = input().split(' ')
l = int(inp[0])
r = int(inp[1])
a = int(inp[2])
if r > l:
	if r - l <= a:
		a = a - (r - l)
		r = r + a // 2
		z = r
	else:
		z = l + a
if l > r:
	if l - r <= a:
		a = a - (l - r)
		l = l + a // 2
		z = l
	else:
		z = r + a
if l == r:
	z = l + a // 2
print(2 * z)


from math import floor
import sys
(l, r, a) = sys.stdin.readline().split()
(l, r, a) = (int(l), int(r), int(a))
min = min(l, r)
max = max(l, r)
if min + a <= max:
	print(2 * (min + a))
else:
	print((min + a + max) // 2 * 2)


(l, r, a) = map(int, input().split())
t1 = a + min(l, r)
t2 = max(l, r)
print(2 * t1 if t1 == min(t1, t2) else 2 * (t2 + (t1 - t2) // 2))


import sys

def main():
	(l, r, a) = map(int, sys.stdin.read().strip().split())
	t = min(abs(l - r), a)
	a = (a - t) // 2
	return 2 * (min(l, r) + t + a)
print(main())


abcd = input().split()
l = int(abcd[0])
r = int(abcd[1])
a = int(abcd[2])
diff = abs(l - r)
if l < r:
	x = min(l + a, r)
	if r == x:
		a = a - diff
		ans = 2 * r + 2 * (a // 2)
	else:
		ans = x * 2
elif r < l:
	y = min(r + a, l)
	if l == y:
		a = a - diff
		ans = 2 * l + 2 * (a // 2)
	else:
		ans = 2 * y
elif l == r:
	ans = 2 * l + 2 * (a // 2)
print(ans)


(a, b, c) = map(int, input().split())
m = min(a, b)
(l, r) = (m, m)
a -= m
b -= m
while a and c:
	l += 1
	r += 1
	a -= 1
	c -= 1
while b and c:
	l += 1
	r += 1
	b -= 1
	c -= 1
while c > 1:
	l += 1
	r += 1
	c -= 2
print(l + r)


(l, r, a) = map(int, input().split())
mx = 0
for i in range(a + 1):
	tl = l + i
	tr = r + a - i
	mx = max(mx, min(tl, tr) * 2)
print(mx)


def maxTeamSize(l, r, a):
	playersLeft = a
	if l > r:
		playersLeft = max(playersLeft - (l - r), 0)
		r += a - playersLeft
	else:
		playersLeft = max(playersLeft - (r - l), 0)
		l += a - playersLeft
	return r + l + playersLeft // 2 * 2 if r == l else min(r, l) * 2
(l, r, a) = map(int, input().split())
print(maxTeamSize(l, r, a))


def team(l, r, a):
	total = 0
	if l == 0 and r == 0:
		if a % 2 == 0:
			return a
		else:
			return a - 1
	if l == 0:
		if a == 0:
			return 0
		if a != 0 and a > r:
			total = 2 * r
			a = a - r
			if a % 2 == 0:
				return total + a
			else:
				return total + a - 1
		if a != 0 and a <= r:
			return 2 * a
	if r == 0:
		if a == 0:
			return 0
		if a != 0 and a > l:
			total = 2 * l
			a = a - l
			if a % 2 == 0:
				return total + a
			else:
				return total + a - 1
		if a != 0 and a <= l:
			return 2 * a
	if a == 0:
		if r >= l:
			return 2 * l
		else:
			return 2 * r
	if l == r:
		if a % 2 == 0:
			return 2 * r + a
		else:
			return 2 * r + a - 1
	if l > r:
		temp = l - r
		total = 2 * r
		if a <= temp:
			return total + 2 * a
		else:
			total = total + 2 * temp
			a = a - temp
			if a % 2 == 0:
				return total + a
			else:
				return total + a - 1
	if r > l:
		temp = r - l
		total = 2 * l
		if a <= temp:
			return total + 2 * a
		else:
			total = total + 2 * temp
			a = a - temp
			if a % 2 == 0:
				return total + a
			else:
				return total + a - 1
lst = input().split()
l = int(lst[0])
r = int(lst[1])
a = int(lst[2])
rval = team(l, r, a)
print(rval)


(l, r, a) = (int(i) for i in input().split())
if r < l:
	d = min(a, l - r)
	r += d
	a -= d
else:
	d = min(a, r - l)
	l += d
	a -= d
print(2 * min(r, l) + a // 2 * 2)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def IF(c, t, f):
	return t if c else f

def YES(c):
	return IF(c, 'YES', 'NO')

def Yes(c):
	return IF(c, 'Yes', 'No')

def main():
	t = 1
	rr = []
	for _ in range(t):
		(a, b, c) = LI()
		if a > b:
			(a, b) = (b, a)
		t = min(b - a, c)
		a += t
		c -= t
		rr.append((a + c // 2) * 2)
	return JA(rr, '\n')
print(main())


lra = list(map(int, input().split()))
if lra[0] > lra[1]:
	temp = min(lra[2], lra[0] - lra[1])
	lra[1] += temp
	lra[2] -= temp
else:
	temp = min(lra[2], lra[1] - lra[0])
	lra[0] += temp
	lra[2] -= temp
print(2 * min(lra[1], lra[0]) + lra[2] - lra[2] % 2)


x = list(map(int, input().strip().split()))
while x[2] > 0:
	if x[0] > x[1]:
		x[1] += 1
		x[2] -= 1
	elif x[0] < x[1]:
		x[0] += 1
		x[2] -= 1
	else:
		break
if x[0] > x[1]:
	print(int(x[1] * 2 + int(x[2] / 2) * 2))
else:
	print(int(x[0] * 2 + int(x[2] / 2) * 2))


(l, r, a) = map(int, input().split())
minn = min(l, r)
maxx = max(l, r)
diff = maxx - minn
if diff == 0:
	minn += a // 2
	maxx += a // 2
elif a >= diff:
	minn += diff
	a -= diff
	minn += a // 2
	maxx += a // 2
else:
	minn += a
print(minn * 2)


import math
(a, b, c) = [int(x) for x in input().split()]
answer = 0
minimum = min(a, b)
diff = abs(a - b)
if diff >= c:
	diff -= c
	minimum += c
	c = 0
	answer = minimum
else:
	minimum += diff
	c -= diff
	diff = 0
	answer = minimum + math.floor(c / 2)
print(answer * 2)


from functools import reduce
line = input()
line = [int(x) for x in line.split()]
somme = min(line[0], line[1])
if line[2] - abs(line[1] - line[0]) >= 0:
	somme += abs(line[1] - line[0]) + (line[2] - abs(line[1] - line[0])) // 2
else:
	somme += line[2]
print(somme * 2)


(l, r, a) = map(int, input().split())
if l > r:
	(l, r) = (r, l)
if l + a <= r:
	print(2 * (l + a))
else:
	k = r - l
	a -= k
	l += k
	print(2 * l + a - a % 2)


(l, r, a) = map(int, input().split())
cnt = 0
(l, r) = (min(l, r), max(l, r))
if l + a <= r:
	print(2 * (l + a))
else:
	cnt = 2 * r
	diff = l + a - r
	cnt += 2 * int(diff / 2)
	print(cnt)


(l, r, a) = input().strip().split(' ')
(l, r, a) = [int(l), int(r), int(a)]
s = abs(l - r)
if s > a:
	t = min(l, r)
	y = t + a
	print(2 * y)
elif s == 0:
	o = int(a / 2)
	l = l + o
	print(2 * l)
else:
	f = min(l, r)
	f = f + s
	a = a - s
	r = int(a / 2)
	u = f + r
	print(2 * u)


s = input().split()
(l, r, a) = (int(s[0]), int(s[1]), int(s[2]))
x = min(l, r)
y = max(l, r)
while a != 0 and x != y:
	x += 1
	a -= 1
print(min(x, y) * 2 + a // 2 * 2)


import base64
import zlib
pro = base64.decodebytes('eJxtUUFuwyAQvPOKVarKkDhOm2MlX/uC3qqqAhs7KBgswGr6+y4QrLqqL7DD7OzMWk2zdQFGGWbu\nPVG59N/rdeLhUu6Om95OpVJBumCtXqlCedkFQgalpYcW3twiSS/FMmLxyrWXhKihzGrwXLx0lEHb\nQjU4e5HmWgHOgKTwQgC/0p/EIoDeGh96ZRC0szR0F6QPjTI7lt4fCsMuoVCqREGgqqH6qjIxBSZo\ncADdTZTXIFie6dCZM8BhDwJOp7SDZuz6zLn3OMXplv+uTKCKwWAdKECDysxLoKzxs1Z4fpRObkb5\n6ZfNTDSDbimlAo44+QDPLI4+MzRBYy1Yto0bxPqINTzCOe7uKSsUlQPKFJFzFtmkWlN3dhKcmhpu\n2xw05R14FyyG1NSwdQm/QJxwY/+93OKGdA2uRgtt3hPp1RALLjzV2OkYmZSJCB40ku/AISORju2M\nXOEPkISOLVzJ/ShtPCedXfwLCdxjfPIDQSHUSQ==\n'.encode())
pro = zlib.decompress(pro)
pro = pro.decode()
exec(pro)


string = input().split(' ')
a = int(string[0])
b = int(string[1])
c = int(string[2])
while c:
	maxx = max(a, b)
	minn = min(a, b)
	minn = minn + 1
	c = c - 1
	a = maxx
	b = minn
print(min(a, b) * 2)


(l, r, a) = map(int, input().split())
(l, r) = (min(l, r), max(l, r))
f = min(r - l, a)
l += f
a -= f
o = l * 2 + a // 2 * 2
print(o)


(a, b, k) = map(int, input().split())
m = max(a, b)
n = min(a, b)
if n + k <= m:
	print((n + k) * 2)
else:
	p = k - (m - n)
	if p % 2 == 0:
		print(m * 2 + p)
	else:
		print(m * 2 + p - 1)


(l, r, a) = list(map(int, input().split()))
n1 = min(l, r)
l -= n1
r -= n1
n1 *= 2
n2 = min(max(l, r), a)
a -= n2
n2 *= 2
n3 = 2 * int(a / 2)
print(n1 + n2 + n3)


from math import floor
(l, r, a) = input().split()
(l, r, a) = (int(l), int(r), int(a))
bodo = max(l, r)
choto = min(l, r)
if a >= bodo - choto:
	b = bodo - choto
	kaj = (b + choto) * 2
	a -= b
	nao = int(floor(a / 2)) * 2
	kaj += nao
	print(kaj)
elif a < bodo - choto:
	b = bodo - choto
	kaj = (a + choto) * 2
	print(kaj)


from math import floor
(l, r, a) = map(int, input().split())
c = floor((l + r + a) / 2)
print(2 * min(l + a, r + a, c))


(a, b, c) = map(int, input().split(' '))
ans = 0
if a <= b:
	c += a
	if c <= b:
		print(2 * c)
	else:
		print(2 * (b + (c - b) // 2))
else:
	c += b
	if c <= a:
		print(2 * c)
	else:
		print(2 * (a + (c - a) // 2))


(l, r, a) = map(int, input().split(' '))
ans = 0
while l > r and a > 0:
	r += 1
	a -= 1
while l < r and a > 0:
	l += 1
	a -= 1
ans += a - a % 2
if l != 0 and r != 0:
	ans += 2 * min(l, r)
print(ans)


line = input().split(' ')
(a, b, c) = line
a = int(a)
b = int(b)
c = int(c)
if a == b:
	d = c / 2
	d = int(d)
	print('%d' % (a * 2 + d * 2))
elif a < b:
	a = a + c
	e = a - b
	e = e / 2
	e = int(e)
	if a == b:
		print('%d' % (a * 2))
	elif a > b:
		print('%d' % (b * 2 + e * 2))
	else:
		print('%d' % (a * 2))
elif b < a:
	b = b + c
	e = b - a
	e = e / 2
	e = int(e)
	if a == b:
		print('%d' % (b * 2))
	elif b > a:
		print('%d' % (a * 2 + e * 2))
	else:
		print('%d' % (b * 2))


def main():
	(l, r, a) = map(int, input().split())
	if l < r:
		d = min(r - l, a)
		l += d
		a -= d
	if r < l:
		d = min(l - r, a)
		r += d
		a -= d
	l += a // 2
	r += a // 2
	ans = 2 * min(l, r)
	print(ans)
main()


(l, r, a) = map(int, input().split())
mn = min(l, r)
mx = max(l, r)
if l == 0 and a == 0 or (r == 0 and a == 0):
	print(0)
elif mx != mn:
	if mn + a <= mx:
		print(2 * (mn + a))
	else:
		rm = mn + a - mx
		if rm % 2:
			print(2 * mx + rm - 1)
		else:
			print(2 * mx + rm)
elif (l + a + r) % 2:
	print(l + a + r - 1)
else:
	print(l + a + r)


x = input()
y = x.split()
l = int(y[0])
r = int(y[1])
a = int(y[2])
m1 = min(l, r) + a
m2 = max(l, r)
if m1 <= m2:
	print(2 * m1)
else:
	d = m1 - m2
	if d % 2 != 0:
		d = d - 1
	print(2 * m2 + d)


(r, l, a) = input().split()
r = int(r)
l = int(l)
a = int(a)

def team(a):
	if a % 2 == 0:
		return a
	else:
		return a - 1

def count(a, b):
	if a > b:
		return 2 * b
	else:
		return 2 * a
while a > 0:
	if r < l:
		r += 1
		a -= 1
	else:
		l += 1
		a -= 1
print(count(l, r))


(l, r, a) = input().split()
l = int(l)
r = int(r)
a = int(a)
if l > 0 and r > 0 and (a > 0):
	if l == r:
		if a % 2 == 0:
			s = l + r + a
			print(s)
		else:
			s = l + r + a - 1
			print(s)
	elif l == r and l == a and (a == r):
		s = l + r + a
		if s % 2 == 0:
			print(s)
		else:
			print(s - 1)
	elif r >= l + a:
		s = l + a
		print(s * 2)
	elif l >= r + a:
		s = r + a
		print(s * 2)
	elif r <= l + a and l <= r + a and (a < l + r) or (a >= l + r and l <= r + a and (r <= l + a)):
		s = l + r + a
		if s % 2 == 0:
			print(s)
		else:
			print(s - 1)
	elif a < l and a < r:
		if r >= a + l:
			s = a + l
			print(s * 2)
		elif l >= a + r:
			s = a + r
			print(s * 2)
elif l == 0 and r > 0 and (a > 0):
	if a >= r:
		s = a + r
		if s % 2 == 0:
			print(s)
		else:
			print(s - 1)
	else:
		s = 2 * r
		print(s)
elif r == 0 and l > 0 and (a > 0):
	if a >= l:
		s = a + l
		if s % 2 == 0:
			print(s)
		else:
			print(s - 1)
	else:
		s = 2 * l
		print(s)
elif a == 0:
	if l <= r:
		s = 2 * l
		print(s)
	else:
		s = 2 * r
		print(s)
elif l == 0 and r == 0 and (a > 0):
	if a % 2 == 0:
		s = a
		print(s)
	else:
		s = a - 1
		print(s)
elif l == 0 and a == 0 and (r > 0) or (l > 0 and r == 0 and (a == 0)):
	print('0')


import sys
import math
import bisect
import itertools

def main():
	(l, r, a) = map(int, input().split())
	ans = 0
	while l > 0 and r > 0:
		ans += 2
		l -= 1
		r -= 1
	while l > 0 and a > 0:
		ans += 2
		l -= 1
		a -= 1
	while r > 0 and a > 0:
		ans += 2
		r -= 1
		a -= 1
	while a >= 2:
		ans += 2
		a -= 2
	print(ans)
main()


(l, r, b) = map(int, input().split())
v = abs(l - r)
if abs(l - r) >= b:
	print((min(l, r) + b) * 2)
else:
	if l < r:
		l += abs(l - r)
	else:
		r += abs(l - r)
	b -= v
	print(2 * (l + b // 2))


import itertools

def main():
	(l, r, a) = [int(v) for v in input().split()]
	d = min(l, r)
	res = d
	v = min(a, max(l, r) - d)
	res += v
	res += max(0, a - v) // 2
	print(res * 2)
main()


(l, r, a) = (int(x) for x in input().split())
if l < r:
	(l, a) = (min(r, l + a), max(0, a - (r - l)))
elif r < l:
	(r, a) = (min(l, r + a), max(0, a - (l - r)))
print(min(l, r) * 2 + 2 * (a // 2))


(l, r, a) = map(int, input().split())
m = 0
for i in range(a + 1):
	right = r + a - i
	left = l + i
	m = max(m, min(left, right) * 2)
print(m)


x = [int(z) for z in input().split()]
l = x[0]
r = x[1]
a = x[2]
if l > r:
	r_0 = r + a
	if r_0 > l:
		r_0 = l
		print(r_0 * 2 + int(abs(a - (l - r)) / 2) * 2)
	else:
		print(r_0 * 2)
if r > l:
	l_0 = l + a
	if l_0 > r:
		l_0 = r
		print(l_0 * 2 + int(abs(a - (r - l)) / 2) * 2)
	else:
		print(l_0 * 2)
if l == r:
	print((l + int(a / 2)) * 2)


a = [int(q) for q in input().strip().split()]
if a[0] < a[1]:
	(a[0], a[1]) = (a[1], a[0])
a[1] += a[2]
if a[1] <= a[0]:
	print(a[1] * 2)
else:
	print(int((a[0] + a[1]) / 2) * 2)


import math
in_put = input('')
in_put = in_put.split(' ')
l = int(in_put[0])
r = int(in_put[1])
a = int(in_put[2])
c = 0
if l > r:
	c = r
	if a > l - r:
		c = c + (l - r)
		a = a - (l - r)
		c = c + math.floor(a / 2)
	elif a <= l - r:
		c = c + a
elif l < r:
	c = l
	if a < r - l:
		c = c + a
	elif a >= r - l:
		c = c + r - l
		a = a - (r - l)
		c = c + math.floor(a / 2)
elif l == r:
	c = l
	c = c + math.floor(a / 2)
print(c * 2, end='')


(r, l, a) = map(int, input().split())
mi = min(r, l)
ma = max(r, l)
tot_mi = min(mi + a, ma)
if mi + a - ma > 0:
	tot_mi += (mi + a - ma) // 2
tot = 2 * tot_mi
print(tot)


(l, r, a) = map(int, input().split())
if l != r:
	L = min(l, r)
	R = max(l, r)
	d = R - L
	if a >= d:
		a = a - d
		print(R + R + a - a % 2)
	else:
		L += a
		print(L * 2)
else:
	re = l * 2 + (a - a % 2)
	print(re)


def test_0():
	import math
	(l, r, a) = list(map(int, input().split(' ')))
	if l < r:
		(l, r) = (r, l)
	b = l - r
	if b > a:
		d = (r + a) * 2
	if b <= a:
		d = (l + r + a) // 2 * 2
	print(d)
test_0()


(l, r, a) = map(int, input().split())
if l > r:
	(l, r) = (r, l)
t = min(a, r - l)
l += t
a -= t
l += a // 2
r += a // 2
print(min(l, r) * 2)


(l, r, b) = map(int, input().split())
if l + b <= r:
	print((l + b) * 2)
elif r + b <= l:
	print((r + b) * 2)
elif l == r:
	l += b // 2
	print(l * 2)
else:
	if l > r:
		(l, r) = (r, l)
	diff = r - l
	l += min(b, diff)
	b -= min(b, diff)
	ans = min(l, r) + b // 2
	print(ans * 2)


(a, b, c) = map(int, input().split())
if a < b:
	temp = b
	b = a
	a = temp
r = a - b
if r <= c:
	b = a
	c -= r
	ans = (b + c // 2) * 2
else:
	ans = (b + c) * 2
print(ans)


(a, b, c) = map(int, input().split())
if a == b:
	c = c // 2
	ans = int(a + c)
	print(ans * 2)
elif c == 0:
	print(min(a, b) * 2)
elif a < b:
	diff = b - a
	if c <= diff:
		print((a + c) * 2)
	else:
		a += diff
		c -= diff
		c = c // 2
		ans = int(a + c)
		print(ans * 2)
elif a > b:
	diff = a - b
	if c <= diff:
		print((b + c) * 2)
	else:
		b += diff
		c -= diff
		c = c // 2
		ans = int(b + c)
		print(ans * 2)


x = [int(x) for x in input().strip().split(' ')]
if x[0] < x[1]:
	(x[0], x[1]) = (x[1], x[0])
if x[2] + x[1] < x[0]:
	ans = x[1] + x[2]
else:
	ans = x[0] + (x[2] - (x[0] - x[1])) // 2
print(ans * 2)


lra = list(map(int, input().split()))
dif = abs(lra[0] - lra[1])
total = 0
if lra[2] > dif:
	total += 2 * max(lra[0], lra[1])
	lra[2] -= dif
	total += 2 * (lra[2] // 2)
else:
	total += 2 * (min(lra[0], lra[1]) + lra[2])
print(total)


(l, r, a) = map(int, input().split())
if min(l, r) + a <= max(l, r):
	print((min(l, r) + a) * 2)
elif (l + r + a) % 2 == 0:
	print(l + r + a)
else:
	print(l + r + a - 1)


(l, r, a) = map(int, input().split())
res = min(l, r)
l -= res
r -= res
res *= 2
aa = max(l, r)
res2 = min(aa, a)
res += res2 * 2
a -= res2
res += a // 2 * 2
print(res)


(l, r, a) = list(map(int, input().split()))
Sum = min(l, r) * 2 + min(a, max(l, r) - min(l, r)) * 2
Sum += int((a - min(a, max(l, r) - min(l, r))) / 2) * 2 if a > min(a, max(l, r) - min(l, r)) else 0
print(Sum)


(i1, i2, a) = map(int, input().split())
l = min(i1, i2)
r = max(i1, i2)
if a >= r - l:
	a -= r - l
	print(r * 2 + a - a % 2)
else:
	print((l + a) * 2)


(l, r, a) = map(int, input().split())
res = min(l, r)
res = min(max(l, r), res + a)
a = max(0, a + min(l, r) - res)
res = res + a // 2
print(res * 2)


(l, r, a) = map(int, input().split())
m = min(l, r)
v = max(l, r)
d = v - m
if a > d:
	print(2 * (v + (a - d) // 2))
else:
	print(2 * (m + a))


(l, r, a) = map(int, input().split())
mini = min(l, r)
team = 0
l -= mini
r -= mini
team = mini * 2
if l == 0 and r > 0:
	f = 0
elif r == 0 and l > 0:
	f = 1
else:
	f = 3
if f == 0:
	if r > a:
		r -= a
		team += a * 2
		a = 0
	elif r < a:
		a -= r
		team += r * 2
		r = 0
	else:
		team += a * 2
		a = 0
		r = 0
	if a % 2 == 0:
		team += a
	else:
		team += a - 1
elif f == 1:
	if l > a:
		l -= a
		team += a * 2
		a = 0
	elif l < a:
		a -= l
		team += l * 2
		l = 0
	else:
		team += a * 2
		a = 0
		l = 0
	if a % 2 == 0:
		team += a
	else:
		team += a - 1
elif a % 2 == 0:
	team += a
else:
	team += a - 1
print(team)


(l, r, a) = map(int, input().split())
s = max(l, r)
d = min(l, r)
h = s - d
if h >= a:
	print((d + a) * 2)
elif a > h:
	t = a - h
	z = int(t / 2)
	p = d + h + z
	print(p * 2)


(l, r, a) = [int(i) for i in input().split()]
m = 0
for i in range(a + 1):
	k = l + i
	d = r + a - i
	m = max(m, min(k * 2, d * 2))
print(m)


(l, r, a) = [int(s) for s in input().split(' ')]
if a == 0:
	print(min(l, r) * 2)
	exit()
diff = abs(l - r)
if diff >= a:
	print((min(l, r) + a) * 2)
	exit()
a = a - diff
if a % 2 == 0:
	print(max(l, r) * 2 + a)
else:
	print(max(l, r) * 2 + a - 1)


(l, r, a) = [int(x) for x in input().split()]
maxi = max(l, r)
mini = min(l, r)
while mini != maxi and a != 0:
	a -= 1
	mini += 1
while a // 2 > 0:
	mini += 1
	maxi += 1
	a -= 2
maxi = mini
print(mini + maxi)


res = 0
(l, r, a) = map(int, input().split(' '))
res = 0
if l < r:
	if a >= r - l:
		temp = r - l
		l += temp
		a -= temp
	else:
		l += a
		a = 0
elif l > r:
	if a >= l - r:
		temp = l - r
		r += temp
		a -= temp
	else:
		r += a
		a = 0
if a > 1 and a % 2 == 0:
	res += a
elif a > 1 and a % 2 == 1:
	res += a - 1
res += min(l, r) * 2
print(res)


import math
(l, r, a) = map(int, input().split())
mn = min(l, r)
req = max(l, r) - mn
if a >= req:
	a -= req
	mn += req
	if a & 1:
		a -= 1
	ans = a + mn * 2
else:
	mn += a
	ans = 2 * mn
print(ans)


(l, r, x) = map(int, input().split())
while x > 0:
	if l <= r:
		x -= 1
		l += 1
	elif r <= l:
		x -= 1
		r += 1
print(min(l, r) * 2)


from __future__ import division, print_function
import itertools, os, sys, threading
from collections import deque, Counter, OrderedDict, defaultdict
import heapq
from math import ceil, floor, log, sqrt, factorial, pow, pi

def ii():
	return int(input())

def si():
	return str(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000

def dfs(v, c):
	if visited[v]:
		if col[v] != c:
			print('-1')
			exit()
		return
	col[v] = c
	visited[v] = 1
	for i in graph[v]:
		dfs(i, c ^ 1)

def bfs(d, v):
	q = []
	q.append(v)
	visited[v] = 1
	while len(q) != 0:
		x = q[0]
		q.pop(0)
		for i in d[x]:
			if visited[i] != 1:
				visited[i] = 1
				q.append(i)
		print(x)
	print(l)

def make_graph(e):
	d = {}
	for i in range(e):
		(x, y) = mi()
		if x not in d.keys():
			d[x] = [y]
		else:
			d[x].append(y)
		if y not in d.keys():
			d[y] = [x]
		else:
			d[y].append(x)
	return d

def gr2(n):
	d = {}
	for i in range(n):
		(x, y) = mi()
		if x not in d.keys():
			d[x] = [y]
		else:
			d[x].append(y)
	return d

def connected_components(graph):
	seen = set()

	def dfs(v):
		vs = set([v])
		component = []
		while vs:
			v = vs.pop()
			seen.add(v)
			vs |= set(graph[v]) - seen
			component.append(v)
		return component
	ans = []
	for v in graph:
		if v not in seen:
			d = dfs(v)
			ans.append(d)
	return ans
(l, r, a) = mi()
if l == r:
	print(2 * l + a // 2 * 2)
elif l < r:
	if l + a <= r:
		print(2 * (l + a))
	else:
		x = 2 * r
		y = l + a - r
		y = y // 2 * 2
		print(x + y)
elif r + a <= l:
	print(2 * (r + a))
else:
	x = 2 * l
	y = r + a - l
	y = y // 2 * 2
	print(x + y)


(l, f, a) = map(int, input().split())
m = min(l, f)
M = max(l, f)
if m + a >= M:
	rem = (a - M + m) // 2
	team = M + rem
else:
	team = m + a
print(2 * team)


(l, r, a) = map(int, input().split())
first = min(l, r)
l = l - first
r = r - first
first = first * 2
val = max(l, r)
if val > 0:
	sec = min(val, a)
	a = a - sec
	first = first + sec * 2
	if a > 0:
		if a % 2 == 0:
			first = first + a
		else:
			first = first + (a - 1)
elif a > 0:
	if a % 2 == 0:
		first = first + a
	else:
		first = first + (a - 1)
print(first)


GI = lambda : int(input())
GIS = lambda : map(int, input().split())
LGIS = lambda : list(GIS())

def main():
	(l, r, a) = GIS()
	while a:
		if l < r:
			l += 1
		else:
			r += 1
		a -= 1
	print(min(l, r) * 2)
main()


(l, r, a) = list(map(int, input().split()))
diff = abs(l - r)
if diff <= a:
	res = diff + min(l, r) + (a - diff) // 2
else:
	res = a + min(l, r)
print(2 * res)


import math
import sys
import string

def ri():
	return input()

def ii():
	return int(input())

def li():
	return input().split()

def mi():
	return list(map(int, input().split()))
(l, r, a) = mi()
for i in range(a):
	if l < r:
		l += 1
	else:
		r += 1
	a -= 1
print(min(l, r) * 2)


(l, r, a) = list(map(int, input().strip().split()))
while a:
	if l <= r:
		l += 1
	else:
		r += 1
	a -= 1
print(min(l, r) * 2)


(l, r, a) = [int(el) for el in input().split()]
if abs(l - r) <= a:
	print(max(l, r) * 2 + (a - abs(l - r)) // 2 * 2)
else:
	print((min(l, r) + a) * 2)


def solution(data):
	left = data[0]
	right = data[1]
	ambide = data[2]
	if left < right:
		return solution([right, left, ambide])
	elif left == right:
		max = right + left + 2 * (ambide // 2)
		print(max)
	elif right + ambide <= left:
		max = 2 * (right + ambide)
		print(max)
	else:
		ambide = ambide - (left - right)
		right = left
		max = right + left + 2 * (ambide // 2)
		print(max)
data = list(map(int, input().split()))
solution(data)


(l, r, a) = map(int, input().split())
ans = 0
x = min(l, r)
m = max(l, r)
z = max(a - (m - x), 0)
x += a - z
a = z
if a % 2 != 0:
	a -= 1
x += a // 2
print(2 * x)


(l, r, a) = [int(s) for s in input().split(' ')]
x = 2 * min(l, r) + 2 * min(a, abs(l - r)) + 2 * max(0, (a - abs(l - r)) // 2)
print(x)


(l, r, a) = map(int, input().split())
if a + min(l, r) < max(l, r):
	print(2 * (a + min(l, r)))
else:
	k = max(l, r) - min(l, r)
	p = a - k
	if p % 2 == 0:
		print(2 * max(l, r) + p)
	else:
		print(2 * max(l, r) + p - 1)


(left, right, ambi) = map(int, input().split())
while ambi > 0:
	if left < right:
		left += 1
	elif left > right:
		right += 1
	elif left == right and ambi % 2 == 0:
		left += 1
		right += 1
		ambi -= 1
	ambi -= 1
print(min(left, right) * 2)


(L, r, a) = [int(x) for x in input().split()]
if L < r:
	(lo, hi) = (L, r)
else:
	(lo, hi) = (r, L)
d = hi - lo
if a > d:
	a -= d
	a = a // 2 * 2
	print(2 * hi + a)
else:
	lo += a
	print(2 * lo)


def F(l, r, a):
	ma = max(l, r)
	mi = min(l, r)
	dif = ma - mi
	if dif > a:
		mi += a
		return mi + (ma - (dif - a))
	elif dif == a:
		mi += a
		return mi + ma
	else:
		a -= dif
		mi += dif
		return mi + ma + (a - a % 2)
tiPidor = [int(p) for p in input().split()]
print(F(tiPidor[0], tiPidor[1], tiPidor[2]))


import sys
(l, r, a) = [int(n) for n in next(sys.stdin).split()]
easy = min(l, r)
deficiency = max(l, r) - min(l, r)
filled = min(deficiency, a)
print((easy + filled + max((a - deficiency) // 2, 0)) * 2)


def leftRight(aa):
	(l, r, a) = (aa[0], aa[1], aa[2])
	if l < r:
		if a >= r - l:
			a -= r - l
			l += r - l
		else:
			l += a
			a = 0
	elif r < l:
		if a >= l - r:
			a -= l - r
			r += l - r
		else:
			r += a
			a = 0
	res = min(r, l) * 2
	if a >= 2:
		res += a // 2 * 2
	return res
nn = list(map(int, input().split()))
print(leftRight(nn))


def main():
	[l, r, a] = [int(_) for _ in input().split()]
	team = min(l, r) * 2
	rest = abs(l - r)
	new_couple = min(a, rest)
	team += new_couple * 2
	a -= new_couple
	team += a if a % 2 == 0 else a - 1
	print(team)
main()


(l, r, a) = map(int, input().split(' '))
ma = max(l, r)
mi = min(l, r)
if ma >= mi + a:
	print((mi + a) * 2)
else:
	dif = (ma - mi) * -1
	if a >= dif:
		mi += dif
		a -= dif
	a = int(a / 2)
	print(mi + ma + a * 2)


(l, r, a) = [int(x) for x in input().split()]
if l == r:
	ans = l * 2 + (a - a % 2)
else:
	mins = min(l, r)
	maxs = max(l, r)
	diff = maxs - mins
	if diff < a:
		a -= diff
		e = a - a % 2
		ans = maxs * 2 + e
	elif diff == a:
		ans = maxs * 2
	else:
		ans = (mins + a) * 2
print(ans)


(l, r, a) = map(int, input().split())
mx = max(l, r)
mn = min(l, r)
if mn + a <= mx:
	print((mn + a) * 2)
else:
	t = 0
	t += mx * 2
	a -= mx - mn
	if a >= 2:
		t += a // 2 * 2
	print(t)


(l, r, a) = map(int, input().split())
print(l + r + a - max(abs(l - r) - a, 0) - (l + r + a - max(abs(l - r) - a, 0)) % 2)


(l, r, a) = map(int, input().split(' '))
diff = abs(l - r)
m = min(l, r)
if a + m < max(l, r):
	print(2 * (a + m))
elif a + m > max(l, r):
	a -= diff
	if a % 2 == 1:
		a -= 1
	print(2 * (m + diff) + a)
elif a + m == max(l, r):
	print(2 * max(l, r))


(l, r, a) = list(map(int, input().split()))
p = max(l, r)
q = min(l, r)
left = p - q
if a != 0:
	res = 2 * (q + min(left, a))
	if a - left > 0 and (a - left) // 2 >= 1:
		if (a - left) % 2 == 0:
			res = res + (a - left)
		else:
			res = res + (a - left) - 1
else:
	res = 2 * q
print(res)


(l, r, a) = map(int, input().split())
while a:
	if l > r:
		(r, a) = (r + min(a, l - r), a - min(a, l - r))
	elif r > l:
		(l, a) = (l + min(a, r - l), a - min(a, r - l))
	else:
		print((l + a // 2) * 2)
		quit()
print(min(l, r) * 2)


arr = list(map(int, input().split()))
d = abs(arr[0] - arr[1])
if d > arr[2]:
	c = min(arr[0], arr[1]) + arr[2]
else:
	c = sum(arr) // 2
print(c * 2)


def main():
	(l, r, a) = map(int, input().split())
	z = abs(l - r)
	if l >= r:
		if z >= a:
			print((r + a) * 2)
		else:
			d = a - z
			print(l * 2 + (d - d % 2))
	elif z >= a:
		print((l + a) * 2)
	else:
		d = a - z
		print(r * 2 + (d - d % 2))
main()


(l, r, a) = [int(a) for a in input().strip().split(' ')]
o = a
if l > r:
	o -= min(a, l - r)
	r += min(a, l - r)
if r > l:
	o -= min(a, r - l)
	l += min(a, r - l)
r += o // 2
l += o // 2
print(2 * min(r, l))


(l, r, a) = list(map(int, input().split()))
ans = 0
b = min(min(l, r) + a, max(l, r))
c = a - abs(b - min(l, r))
ans += int(c / 2) + b
print(2 * ans)


(l, r, a) = list(map(int, input().split()))
s = 0
for i in range(a + 1):
	s = max(s, 2 * min(l + i, r + a - i))
print(s)


(l, r, m) = map(int, input().split())
if l + m <= r:
	print(2 * (l + m))
elif r + m <= l:
	print(2 * (r + m))
elif l < r:
	m = m - (r - l)
	l = r
	k = m // 2
	print(2 * (l + k))
else:
	m = m - (l - r)
	r = l
	k = m // 2
	print(2 * (r + k))


import sys
[l, r, a] = map(int, sys.stdin.readline().strip().split())
if l > r:
	(r, l) = (l, r)
if a < r - l:
	print(2 * (l + a))
else:
	print(2 * ((l + r + a) // 2))


(l, r, a) = map(int, input().split())
if l == 0 and a == 0 or (r == 0 and a == 0):
	print('0')
elif abs(l - r) < a:
	w = 2 * max(l, r) + (a - abs(l - r)) // 2 * 2
	print(w)
else:
	print(2 * (min(l, r) + a))


(x, y, z) = map(int, input().split())
if abs(x - y) <= z:
	z -= abs(x - y)
	if x < y:
		x = y
	elif x > y:
		y = x
	print((x + z // 2) * 2)
else:
	if x < y:
		x += z
	elif x > y:
		y += z
	print(min(x, y) * 2)


(l, r, a) = map(int, input().split(' '))
if l == r:
	while a >= 2:
		l += 1
		a -= 2
	print(l * 2)
elif l > r:
	if r + a >= l:
		while l != r:
			r += 1
			a -= 1
		while a >= 2:
			l = l + 1
			a -= 2
		print(l * 2)
	elif r + a < l:
		print((r + a) * 2)
elif l < r:
	if l + a >= r:
		while r != l:
			l += 1
			a -= 1
		while a >= 2:
			r = r + 1
			a -= 2
		print(r * 2)
	elif l + a < r:
		print((l + a) * 2)


def lra_(l, r, a):
	if l == r:
		return (l + a // 2) * 2
	else:
		lm = min(l, r)
		rm = max(l, r)
		(l, r) = (lm, rm)
		if a <= r - l:
			return 2 * (l + a)
		else:
			return 2 * (r + (a - r + l) // 2)
lra = input().split()
print(lra_(int(lra[0]), int(lra[1]), int(lra[2])))


s = 0
sum = 0
(z, x, c) = [int(i) for i in input().split()]
if z == x:
	if c % 2 == 0:
		sum = z * 2 + c
	else:
		sum = z * 2 + (c - 1)
if z != x:
	if z > x:
		m = z
		n = x
	else:
		m = x
		n = z
	if 0 < n + c:
		if n + c <= m:
			sum = (n + c) * 2
		elif (c + n - m) % 2 == 0:
			sum = m * 2 + (c + n - m)
		else:
			sum = m * 2 + (c + n - m - 1)
print(sum)


(l, r, a) = map(int, input().split())
ans = 0
ans += min(l, r)
l -= ans
r -= ans
if l != 0:
	tmp = min(l, a)
	ans += tmp
	l -= tmp
	a -= tmp
if r != 0:
	tmp = min(r, a)
	ans += tmp
	r -= tmp
	a -= tmp
ans += a // 2
print(ans * 2)


(left, right, ambi) = map(int, input().split())
if left < right:
	add = right - left
	if ambi >= add:
		left += add
		ambi -= add
	else:
		left += ambi
		ambi = 0
else:
	add = left - right
	if ambi >= add:
		right += add
		ambi -= add
	else:
		right += ambi
		ambi = 0
addmore = ambi // 2
left += addmore
right += ambi - addmore
print(2 * min(left, right))


(left, right, ambidekstr) = map(int, input().split())
if (left == 0 or right == 0) and ambidekstr == 0:
	print(0)
	exit()
for i in range(ambidekstr):
	if left == min(left, right):
		left += 1
	else:
		right += 1
print(min(left, right) * 2)


(a, b, c) = map(int, input().split())
while c != 0:
	if a > b:
		b += 1
	else:
		a += 1
	c -= 1
if a > b:
	print(b * 2)
else:
	print(a * 2)


(x, r, a) = [int(x) for x in input().split()]
t = min(a, abs(x - r))
if x > r:
	r += t
	a -= t
else:
	x += abs(t)
	a -= abs(t)
a -= a % 2
while a > 0:
	a -= 2
	r += 1
	x += 1
print(2 * min(x, r))


(l, r, a) = map(int, input().split())
x = 0
s = l + r + a
if r > l:
	if r > l + a:
		print((l + a) * 2)
	elif (l + a - r) % 2 == 0:
		x = l + a - r
		print(r * 2 + x)
	else:
		x = l + a - r
		print(r * 2 + x - 1)
elif r == l:
	if a % 2 == 0:
		print(r + l + a)
	else:
		print(r + l + a - 1)
elif l > r + a:
	print((r + a) * 2)
elif (r + a - l) % 2 == 0:
	x = r + a - l
	print(l * 2 + x)
else:
	x = r + a - l
	print(l * 2 + x - 1)


def main():
	(l, r, a) = map(int, input().split())
	print(min((l + a) * 2, (r + a) * 2, l + r + a & 510))
main()


def solve(l, r, a):
	x = abs(l - r)
	y = min(x, a)
	x = min(l, r) + y
	return (x + (a - y) // 2) * 2

def main():
	(l, r, a) = list(map(int, input().split()))
	print(solve(l, r, a))
main()


(l, r, a) = input().split()
l = int(l)
r = int(r)
a = int(a)
mi = min(l, r)
ma = max(l, r)
d = ma - mi
ans = 0
if a > d:
	ans = ma + int((a - d) / 2)
else:
	ans = mi + a
print(ans * 2)


(l, r, a) = [int(x) for x in input().split()]
less = min(l, r)
more = max(l, r)
if less + a <= more:
	v = less + a
else:
	v = more + (a - (more - less)) // 2
print(v * 2)


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_intList_from_str = lambda : list(map(int, list(sys.stdin.readline().strip())))
get_charList_from_str = lambda : list(sys.stdin.readline().strip())
get_char_list = lambda : sys.stdin.readline().strip().split()
get_int = lambda : int(sys.stdin.readline())
pt = lambda x: sys.stdout.write(str(x))
(l, r, a) = get_int_list()
if l == r:
	print(l + r + a - a % 2)
else:
	diff = abs(r - l)
	if diff <= a:
		a -= diff
		print(l + r + diff + a - a % 2)
	else:
		m = min(l, r) + a
		print(2 * m)


(l, r, a) = map(int, input().split())
ans = 0
if l < r and a != 0:
	sub = r - l
	if sub - a > 0:
		ans = (l + a) * 2
	elif sub - a == 0:
		ans = r * 2
	else:
		_sub = a - sub
		ans = (r + _sub // 2) * 2
elif l > r and a != 0:
	sub = l - r
	if sub - a > 0:
		ans = (r + a) * 2
	elif sub - a == 0:
		ans = l * 2
	else:
		_sub = a - sub
		ans = (l + _sub // 2) * 2
elif l == r and a != 0:
	isy = a // 2
	ans = (l + isy) * 2
elif a == 0:
	_min = min([l, r])
	ans = _min * 2
print(ans)


a = list(map(int, input().split()))
t = min(a[0], a[1])
r = max(a[0], a[1])
k = a[2] + t - r
n = k > 0
m = (t + min(r - t, a[2]) + n * k // 2) * 2
print(m)


(l, r, a) = map(int, input().split())
members = 0
if l > r and l - r <= a:
	members += r
	members += l
	members += l - r
	a -= l - r
	if a > 0:
		if a % 2 == 0:
			members += a
		else:
			members += a - 1
	print(members)
elif r > l and r - l <= a:
	members += r
	members += l
	members += r - l
	a -= r - l
	if a > 0:
		if a % 2 == 0:
			members += a
		else:
			members += a - 1
	print(members)
elif r == l:
	members += r + l
	if a > 0:
		if a % 2 == 0:
			members += a
		else:
			members += a - 1
	print(members)
else:
	b = 0
	if l > r:
		b = r
	elif r > l:
		b = l
	members += b
	members += a
	members += b + a
	print(members)


(l, r, a) = map(int, input().split())
if r > l:
	x = r - l
	if a > x:
		l += x
		a -= x
	elif a <= x:
		l += a
		a = 0
elif l > r:
	x = l - r
	if a > x:
		r += x
		a -= x
	elif a <= x:
		r += a
		a = 0
if a != 0:
	flag = 0
	for i in range(a):
		if flag == 0:
			l += 1
			flag = 1
		elif flag == 1:
			r += 1
			flag = 0
x = min(l, r)
print(x * 2)


people = input().split(' ')
leftHander = int(people[0])
righttHander = int(people[1])
ambiDexter = int(people[2])
maxPeople = max(leftHander, righttHander)
minPeople = min(leftHander, righttHander)
if maxPeople - minPeople <= ambiDexter:
	ans = 2 * (maxPeople + (ambiDexter - maxPeople + minPeople) // 2)
else:
	ans = 2 * (ambiDexter + minPeople)
print(int(ans))


(a, b, s) = map(int, input().split())
if a > b:
	t = b
	b += min(a - b, s)
	s -= b - t
else:
	t = a
	a += min(b - a, s)
	s -= a - t
print((min(a, b) + s // 2) * 2)


(l, r, a) = map(int, input().split())
(mn, mx) = (min(l, r), max(l, r))
diff = mx - mn
mn += min(diff, a)
a -= min(diff, a)
if a > 0:
	mn += a // 2
	mx += a // 2
print(2 * min(mn, mx))


(x, y, z) = map(int, input().split())
c = abs(x - y)
if x == 0 and z == 0 or (y == 0 and z == 0):
	print(0)
elif c <= z:
	z -= c
	print(2 * (z // 2) + 2 * max(x, y))
else:
	print(2 * (min(x, y) + z))


def main():
	line = input()
	(l, r, a) = line.split(' ')
	l = int(l)
	r = int(r)
	a = int(a)
	_max = max(l, r)
	_min = min(l, r)
	diff = _max - _min
	if diff == 0:
		print((l + a // 2) * 2)
	elif diff <= a:
		print(_max * 2 + (a - diff) // 2 * 2)
	else:
		print((_min + a) * 2)
main()


(l, r, a) = input().split()
(l, r, a) = (int(l), int(r), int(a))
ans = min([l + a, r + a, int((l + r + a) / 2)])
ans *= 2
print(ans)


(l, r, a) = map(int, input().split())
team = min(l, r)
if max(l, r) - min(l, r) == 0:
	team += a // 2
else:
	team += min(max(l, r) - min(l, r), a)
	if min(max(l, r) - min(l, r), a) != a:
		team += (a - min(max(l, r) - min(l, r), a)) // 2
print(team * 2)


s = list(map(int, input().split()))
l = s[0]
r = s[1]
a = s[2]
ans = 0
while True:
	if l == r:
		temp = a // 2
		ans = l + r + temp * 2
		break
	elif l > r:
		if a != 0:
			r += 1
			a -= 1
		else:
			ans = r * 2
			break
	elif r > l:
		if a > 0:
			l += 1
			a -= 1
		else:
			ans = l * 2
			break
print(ans)


(l, r, a) = map(int, input().split())
c = 0
left = 0
if l < r:
	c = c + 2 * l
	r = r - l
	left = r
else:
	c = c + 2 * r
	l = l - r
	left = l
if a >= left:
	c = c + 2 * left
	a = a - left
	left = 0
else:
	c = c + 2 * a
	left = left - a
	a = 0
if a > 0:
	c = c + 2 * (a // 2)
print(c)


s = input().split()
(l, p, a) = (int(s[0]), int(s[1]), int(s[2]))
r = abs(l - p)
if a >= r:
	print(l + p + r + 2 * ((a - r) // 2))
else:
	print(2 * min(l, p) + 2 * a)


import sys
(l, r, a) = (int(x) for x in next(sys.stdin).split())
hands = sorted([l, r])
if a <= hands[1] - hands[0]:
	print(2 * (hands[0] + a))
else:
	print((l + r + a) // 2 * 2)


(l, r, a) = list(map(int, input().split()))
while a > 0:
	if l <= r:
		l += 1
	else:
		r += 1
	a -= 1
if l == r:
	team = l + r
elif l < r:
	team = r - (r - l) + l
else:
	team = l - (l - r) + r
print(team)


(l, r, a) = map(int, input().split())
minn = min(l, r)
maxx = max(l, r)
ans = minn * 2
maxx -= minn
if maxx >= a:
	ans += a
	ans += a
else:
	ans += maxx
	ans += maxx
	a -= maxx
	if a >= 0:
		ans += a // 2
		ans += a // 2
print(ans)


(a, b, c) = map(int, input().split())
m = min(a, b)
a -= m
b -= m
ans = m
m = min(max(a, b), c)
ans += m
c -= m
if c > 0:
	ans += c // 2
print(ans * 2)


(l, r, a) = [int(i) for i in input().split()]
if l >= r and l != a != 0 and (r != a != 0):
	if l - r >= a:
		r = r + a
		l = r
		print(l + r)
	else:
		a = a - l + r
		r = l
		if a % 2 == 0:
			print(l + r + a)
		else:
			print(l + r + a - 1)
elif l < r and l != a != 0 and (r != a != 0):
	if r - l >= a:
		l = l + a
		r = l
		print(l + r)
	else:
		a = a - r + l
		l = r
		if a % 2 == 0:
			print(l + r + a)
		else:
			print(l + r + a - 1)
elif l == a != 0:
	a = r
	r = l
	if a % 2 == 0:
		print(l + r + a)
	else:
		print(l + r + a - 1)
elif r == a != 0:
	a = l
	l = r
	if a % 2 == 0:
		print(l + r + a)
	else:
		print(l + r + a - 1)
elif l != 0 and r != 0 and (a == 0):
	if l >= r:
		l = r
		print(l + r)
	else:
		r = l
		print(l + r)
else:
	print(0)


(l, r, a) = map(int, input().split())
large = max(l, r)
small = min(l, r)
x = large - small
print((small + a) * 2 if x >= a else 2 * (large + int((a - x) / 2)))


a = input()
x = a.split()
l = int(x[0])
r = int(x[1])
b = int(x[2])
if l > r:
	b -= l - r
	r = l
	if b >= 0:
		if b % 2 == 0:
			r += b / 2
			print(int(r * 2))
			exit()
		else:
			r += b / 2 - 1
			print(int(r * 2) + 1)
			exit()
	else:
		r += b
		print(r * 2)
else:
	b -= r - l
	l = r
	if b >= 0:
		if b % 2 == 0:
			r += b / 2
			print(int(r * 2))
			exit()
		else:
			r += b / 2 - 1
			print(int(r * 2) + 1)
			exit()
	else:
		r += b
		print(r * 2)


(l, r, a) = map(int, input().split())
ans = 0
ans = min(l, r) * 2
l -= ans // 2
r -= ans // 2
if l > 0:
	t = min(l, a)
	l -= t
	a -= t
	ans += t * 2
else:
	t = min(r, a)
	r -= t
	a -= t
	ans += t * 2
if a > 0:
	ans += a // 2 * 2
print(ans)


import sys
(a, b, c) = input().split(' ')
(a, b, c) = [int(a), int(b), int(c)]
if a == b:
	print(a + b + (c - c % 2))
elif a < b:
	d = b - a
	if d > c:
		a = a + c
		b = b - abs(a - b)
	else:
		a = a + d
		c = c - d
		a = a + c // 2
		b = b + c // 2
	print(2 * a)
	sys.exit(0)
else:
	d = a - b
	if d > c:
		b = b + c
		a = a - abs(a - b)
	else:
		b = b + d
		c = c - d
		a = a + c // 2
		b = b + c // 2
	print(2 * b)
	sys.exit(0)


(l, r, a) = [int(i) for i in input().split()]
m = 0
for i in range(a + 1):
	l1 = l + i
	r1 = r + a - i
	m = max(m, min(l1, r1) * 2)
print(m)


def this(l, r, a):
	ans = 0
	while True:
		if l == 0:
			if a == 0:
				return ans
			else:
				a -= 1
		else:
			l -= 1
		if r == 0:
			if a == 0:
				return ans
			else:
				a -= 1
		else:
			r -= 1
		ans += 2
(l, r, a) = map(int, input().split())
print(this(l, r, a))


(l, r, a) = input().split()
l = int(l)
r = int(r)
a = int(a)
d = max(l, r) - min(l, r)
if a <= d:
	ans = 2 * (min(l, r) + a)
else:
	a = a - d
	ans = 2 * (max(r, l) + a // 2)
print(ans)


(l, r, am) = map(int, input().split())
(a, b) = (min(l, r), max(l, r))
diff = b - a
if am <= diff:
	a += am
else:
	a = a + diff
	rem = am - diff
	a = a + rem // 2
	b = b + rem // 2
print(min(a, b) * 2)


(l, r, a) = input().split()
l = int(l)
r = int(r)
a = int(a)
x = [l, r, a]
if l == r == a:
	s = a // 2
	t = l + r + 2 * s
	print(t)
else:
	if min(x) == x[0]:
		s = min(x) + a
		if s <= r:
			print(2 * s)
		else:
			u = s - r
			if u > 1:
				if u % 2 != 0:
					u = u - 1
			t = u // 2 + r
			print(2 * t)
	if min(x) == x[1] and x[1] != x[0]:
		s = min(x) + a
		if s <= l:
			print(2 * s)
		else:
			u = s - l
			if u > 1:
				if u % 2 != 0:
					u = u - 1
			t = u // 2 + l
			print(2 * t)
	if min(x) == x[2] and x[2] != x[1] and (x[2] != x[0]):
		if l > r:
			s = r + a
			if s <= l:
				print(2 * s)
			else:
				u = s - l
				if u > 1:
					if u % 2 != 0:
						u = u - 1
				t = u // 2 + l
				print(2 * t)
		else:
			s = l + a
			if s <= r:
				print(2 * s)
			else:
				u = s - r
				if u > 1:
					if u % 2 != 0:
						u = u - 1
				t = u // 2 + r
				print(2 * t)


import math
hand = [int(x) for x in input().split()]
left = hand[0]
right = hand[1]
ambd = hand[2]
if left < right:
	while left != right and ambd:
		left = left + 1
		ambd = ambd - 1
else:
	while left != right and ambd:
		right = right + 1
		ambd = ambd - 1
left = right = min(left, right)
if ambd > 1:
	right = right + math.floor(ambd / 2)
	left = left + math.floor(ambd / 2)
if right != left:
	print(0)
else:
	print(right + left)


(x, y, z) = map(int, input().split())
if x > y:
	a = x - y
	b = min(a, z)
	y = y + b
	z = z - b
else:
	a = y - x
	b = min(a, z)
	x = x + b
	z = z - b
if z > 1:
	p = z // 2
	p = p * 2
	print(min(x, y) * 2 + p)
else:
	print(min(x, y) * 2)


def solve(l, r, a):
	(x, y) = (min(l, r), max(l, r))
	if x + a <= y:
		return 2 * (x + a)
	k = y + x + a
	if k % 2 == 1:
		return k - 1
	else:
		return k
(l, r, a) = map(int, input().split())
print(solve(l, r, a))


(l, r, a) = map(int, input().split())
if l != r:
	ma = max(l, r)
	mi = min(l, r)
	p = ma - mi
	b = min(ma, mi + a)
	r = a - p
	if r > 0:
		if r % 2 == 0:
			b = b * 2 + r
			print(b)
		else:
			b = b * 2 + r // 2 * 2
			print(b)
	else:
		print(b * 2)
else:
	print(l + r + a // 2 * 2)


(l, r, a) = map(int, input().split())
ans = min(l, r)
l -= ans
r -= ans
if l > 0:
	temp = min(l, a)
	l -= temp
	a -= temp
	ans += temp
if r > 0:
	temp = min(r, a)
	r -= temp
	a -= temp
	ans += temp
if a > 1:
	ans += a // 2
print(ans * 2)


(l, r, a) = map(int, input().split())
dif = max(l, r) - min(l, r)
people = 0
if a > dif:
	people += max(l, r) * 2
	a -= dif
	people += a // 2 * 2
	print(people)
elif a == dif:
	print(max(l, r) * 2)
else:
	people = (min(l, r) + a) * 2
	print(people)


def solve(l, r, a):
	while a > 0:
		if l < r:
			l += 1
		else:
			r += 1
		a -= 1
	return min([l, r]) * 2

def main():
	lra = input().split()
	print(solve(int(lra[0]), int(lra[1]), int(lra[2])))
main()


(l, r, a) = map(int, input().split())
pair1 = min(l, r)
pair2 = min(abs(l - r), a)
pair3 = (a - pair2) // 2
result = (pair1 + pair2 + pair3) * 2
print(result)


(a, b, c) = map(int, input().split())
mina = min(a, b)
maxb = max(a, b)
if mina + c <= maxb:
	print((mina + c) * 2)
else:
	print((a + b + c) // 2 * 2)


(l, r, a) = map(int, input().split())
if a == 0:
	min_ = min(l, r)
	print(2 * min_)
elif a != 0:
	if l < r:
		if r - l >= a:
			l += a
			print(2 * min(l, r))
		elif r - l < a:
			temp = r - l
			l += temp
			a -= temp
			x = a // 2
			l += x
			r += x
			print(2 * min(l, r))
	elif l > r:
		if l - r >= a:
			r += a
			print(2 * min(l, r))
		elif l - r < a:
			temp = l - r
			r += temp
			a -= temp
			x = a // 2
			l += x
			r += x
			print(2 * min(l, r))
	else:
		temp = a // 2
		l += temp
		r += temp
		print(2 * min(l, r))


(l, r, a) = map(int, input().split())
if l > r:
	h = l
	l = r
	r = h
l_a = l + a
if l_a == r:
	print(r * 2)
elif l_a < r:
	print(l_a * 2)
elif l_a > r:
	print(2 * r + (l_a - r) // 2 + (l_a - r) // 2)


(a, b, c) = input().split(' ')
a = int(a)
b = int(b)
c = int(c)
if a > b:
	y = b + c
	if y > a:
		if (c - a + b) % 2 == 0:
			print(a * 2 + (c - a + b))
		else:
			print(a * 2 + (c - a + b - 1))
	else:
		print(y * 2)
elif b > a:
	y = a + c
	if y > b:
		if (c - b + a) % 2 == 0:
			print(b * 2 + (c - b + a))
		else:
			print(b * 2 + (c - b + a - 1))
	else:
		print(y * 2)
if a == b:
	j = a + b + c
	if j % 2 == 0:
		print(j)
	else:
		print(j - 1)


(l, r, a) = input().split()
l = int(l)
a = int(a)
r = int(r)
m = min(l, r)
while (m != max(l, r)) & (a != 0):
	a -= 1
	m += 1
if a > 1:
	m += a // 2
print(m * 2)


import math
from sys import stdin
string = stdin.readline().strip().split()
l = int(string[0])
r = int(string[1])
a = int(string[2])
diff = abs(l - r)
if diff <= a:
	output = max(l, r) * 2 + (a - diff) - (a - diff) % 2
else:
	output = (min(l, r) + a) * 2
print(output)


x = list(map(int, input().split()))
if x[0] == x[1]:
	print(2 * (sum(x) // 2))
elif min(x[0], x[1]) + x[2] <= max(x[0], x[1]):
	print(2 * (min(x[0], x[1]) + x[2]))
else:
	x[2] -= max(x[0], x[1]) - min(x[0], x[1])
	print(2 * ((2 * max(x[0], x[1]) + x[2]) // 2))


ln = input()
ln = ln.split(' ')
left = int(ln[0])
right = int(ln[1])
a = int(ln[2])
if left < right:
	if right - left >= a:
		print(2 * (a + left))
	else:
		a -= right - left
		a = int(a / 2)
		print(2 * (right + a))
elif left - right >= a:
	print(2 * (right + a))
else:
	a -= left - right
	a = int(a / 2)
	print((left + a) * 2)


(l, r, a) = input().split()
l = int(l)
r = int(r)
a = int(a)
if l < r and a > r - l:
	print(2 * (l + (r - l) + (a - (r - l)) // 2))
elif l < r and a <= r - l:
	print(2 * (l + a))
elif l > r and a > l - r:
	print(2 * (r + (l - r) + (a - (l - r)) // 2))
elif l > r and a <= l - r:
	print(2 * (r + a))
elif l == r:
	print(2 * (r + a // 2))


(l, r, a) = map(int, input().split())
if l + r + a > 0:
	x = min(l, r)
	y = max(l, r)
	z = y - x
	if a >= z:
		x = y
		a -= z
		t = x * 2
	else:
		t = (a + x) * 2
		a = 0
	if a > 0:
		x = x + a // 2
		t = x * 2
	print(t)
else:
	print('0')


(l, r, a) = map(int, input().split())
print(2 * max([min(l + m, r + a - m) for m in range(a + 1)]))


import sys
import bisect
input = sys.stdin.readline
t = 1
mod = 10 ** 9 + 7
for _ in range(t):
	(l, r, b) = map(int, input().split())
	mini = min(l, r)
	maxi = max(l, r)
	req = maxi - mini
	ex = min(b, req)
	mini += ex
	b -= ex
	maxi += b // 2
	mini += b // 2
	print(2 * min(maxi, mini))


a = list(map(int, input().split()))
if a[2] - abs(a[0] - a[1]) >= 0:
	print((int((a[2] - abs(a[0] - a[1])) / 2) + max(a[0], a[1])) * 2)
else:
	print((min(a[0], a[1]) + a[2]) * 2)


string = input().split(' ')
l = int(string[0])
r = int(string[1])
a = int(string[2])
x = 0
if l > r:
	x += r
	if a > l - r:
		x += l - r
		a -= l - r
		x += a // 2
	else:
		x += a
else:
	x += l
	if a > r - l:
		x += r - l
		a -= r - l
		x += a // 2
	else:
		x += a
print(x * 2)


(l, r, a) = map(int, input().strip().split())
ans = 0
if l + r >= 0:
	mi = min(l, r)
	l -= mi
	r -= mi
	m = max(l, r)
	nv = 2 * mi
	if m <= a:
		ans = nv + 2 * m + 2 * ((a - m) // 2)
	else:
		nv += 2 * a
		ans = nv
print(ans)


(a, b, c) = map(int, input().split())
if c - abs(a - b) > 0:
	print((max(a, b) + (c - abs(a - b)) // 2) * 2)
else:
	print((min(a, b) + c) * 2)


s = input()
num = [int(x) for x in s.split(' ')]
maxnum = max(num[0], num[1])
minnum = min(num[0], num[1])
dev = maxnum - minnum
if num[2] - dev > 0:
	ans = (maxnum + (num[2] - dev) // 2) * 2
elif num[2] - dev < 0:
	ans = (minnum + num[2]) * 2
else:
	ans = maxnum * 2
print(ans)


(l, r, a) = list(map(int, input().split()))
s = min(l, r) * 2
d = min(a, abs(l - r))
a -= d
s += d * 2
if a > 0:
	s += 2 * (a // 2)
print(s)


linea_ingresada = input()
(zurdos, derechos, ambidiestros) = linea_ingresada.split(' ')
zurdos = int(zurdos)
derechos = int(derechos)
ambidiestros = int(ambidiestros)
if zurdos > derechos:
	diferencia = zurdos - derechos
	if diferencia >= ambidiestros:
		resultado = derechos + ambidiestros
	else:
		resultado = zurdos + (ambidiestros - diferencia) / 2
elif derechos > zurdos:
	diferencia = derechos - zurdos
	if diferencia >= ambidiestros:
		resultado = zurdos + ambidiestros
	else:
		resultado = derechos + (ambidiestros - diferencia) / 2
else:
	resultado = zurdos + ambidiestros / 2
print(int(resultado) * 2)


(l, r, a) = map(int, input().split())
ans = 0
for i in range(1, 1000):
	nr = r - i
	nl = l - i
	na = a + 0
	if nl < 0:
		na += nl
	if nr < 0:
		na += nr
	if na >= 0:
		ans = i + 0
print(ans * 2)


def determineValue(value, newMin):
	if value > newMin:
		if value - newMin > 1:
			return newMin + (value - newMin) // 2
		return newMin
	return value

def main():
	testCase = input()
	testCase = testCase.split()
	testCase = list(map(int, testCase))
	minIndex = testCase.index(min(testCase[:2]))
	minValue = testCase[minIndex]
	value = minValue + testCase[-1]
	if minIndex == 0:
		print(determineValue(value, testCase[1]) * 2)
	elif minIndex == 1:
		print(determineValue(value, testCase[0]) * 2)
main()


import sys
(l, p, a) = input().split()
l = int(l)
p = int(p)
a = int(a)
y = 0
r = 0
if l <= p:
	l = l + a
	if l == p:
		print(l * 2)
	elif l < p:
		print(l * 2)
	elif l > p:
		if (l - p) % 2 == 0:
			p += (l - p) / 2
			p = int(p)
			print(p * 2)
		else:
			r = l - p
			l = l - r
			y = r / 2
			y = int(y)
			l += y
			p += y
			print(l * 2)
	sys.exit()
if p < l:
	p = p + a
	if l == p:
		print(l * 2)
	elif p < l:
		print(p * 2)
	elif p > l:
		if (p - l) % 2 == 0:
			l += (p - l) / 2
			l = int(l)
			print(l * 2)
		else:
			r = p - l
			p = p - r
			y = r / 2
			y = int(y)
			l += y
			p += y
			print(l * 2)


(l, r, a) = map(int, input().split())
if l < r:
	d = min(r - l, a)
	l += d
	a -= d
elif l > r:
	d = min(l - r, a)
	r += d
	a -= d
ans = 2 * min(l, r) + (a - a % 2)
print(ans)


(l, r, a) = [int(x) for x in input().split()]
n = min(l, r)
m = max(l, r)
while a != 0:
	if n == m:
		n += a // 2
		m += a // 2
		a = 0
		continue
	n += 1
	a -= 1
print(n * 2)


(a, b, c) = map(int, input().split())
g = max(a, b)
a = min(a, b)
b = g
x = b - a
a = a + min(x, c)
b = a
c = c - min(x, c)
print(a + b + c - c % 2)


(a, b, c) = map(int, input().split())
r = min(a + b - min(a, b) * 2, c)
rez = (min(a, b) + (c - r) // 2 + r) * 2
print(rez)


def team(l, r, a):
	for i in range(l, -1, -1):
		for j in range(r, -1, -1):
			for k in range(a, -1, -1):
				for p in range(a, -1, -1):
					if k + p <= a and i + k == j + p:
						return i + j + k + p
L = list(map(int, input().split()))
l = L[0]
r = L[1]
a = L[2]
print(team(l, r, a))


def smbg(a, b):
	if a > b:
		return b
	elif b > a:
		return a

def hig(a, b):
	if a > b:
		return a
	elif b > a:
		return b
(l, r, a) = map(int, input().strip().split())
if l == '0' and a == '0':
	print('0')
elif r == '0' and a == '0':
	print('0')
elif r - l == 0:
	amb = a // 2
	left = l + amb
	right = r + amb
	print(left + right)
elif r - l >= a or l - r >= a or a == 0:
	le = smbg(l, r)
	hi = hig(l, r)
	lo = le + a
	ri = hi - lo
	rig = hi - ri
	print(lo + rig)
elif (r - l < a or l - r < a) and a != 0:
	lo = smbg(l, r)
	hi = hig(l, r)
	lef = lo + (hi - lo)
	am = a - (hi - lo)
	amb = am // 2
	left = lef + amb
	right = hi + amb
	print(left + right)


(l, r, a) = map(int, input().split())
if l > r:
	(l, r) = (r, l)
n = [r + (a - (r - l)) // 2, l + a][r - l > a] * 2
print(n)


line = input()
(l, r, a) = list(map(int, line.strip().split()))
mmin = min(l, r)
mmax = max(l, r)
if a + mmin <= mmax:
	print(2 * (a + mmin))
else:
	left = a + mmin - mmax
	print(2 * (mmax + left // 2))


string = input().split(' ')
lh = int(string[0])
rh = int(string[1])
am = int(string[2])
for i in range(0, am):
	if lh < rh:
		lh += 1
	else:
		rh += 1
print(min(lh, rh) * 2)


(l, r, a) = [int(i) for i in input().split()]
if l > r:
	(l, r) = (r, l)
if l + a <= r:
	print((l + a) * 2)
	exit()
left = l + a - r
print(r * 2 + (left - left % 2))


import sys
(l, r, a) = [int(x) for x in input().split()]
diff = max(l, r) - min(l, r)
ma = max(l, r)
mi = min(l, r)
res = mi
if diff <= a:
	a = a - diff
	a = int(a / 2)
	res = ma + a
else:
	res = mi + a
print(2 * res)


(l, r, a) = map(int, input().split())
if l > r:
	t = l
	l = r
	r = t
p = r - l
if p >= a:
	l += a
else:
	l = r
	l += int((a - p) // 2)
print(l * 2)


from collections import Counter

def func():
	(l, r, a) = map(int, input().split())
	t = min(l, r)
	p = max(l, r)
	tot = 0
	if a + t <= p:
		tot = (a + t) * 2
	elif a + t > p:
		c = p
		a -= p - t
		tot = 2 * (c + int(a / 2))
	print(tot)
t = 1
for i in range(t):
	func()


s = list(map(int, input().split()))
l = s[0]
r = s[1]
a = s[2]
m = min(l, r)
c = 0
c = c + m + m
l = l - m
r = r - m
if r == 0:
	if l >= a:
		c = c + a + a
	else:
		c = c + l + l
		a = a - l
		p = a // 2
		c = c + p + p
elif l == 0:
	if r >= a:
		c = c + a + a
	else:
		c = c + r + r
		a = a - r
		p = a // 2
		c = c + p + p
print(c)


def inpt():
	p = input().split()
	return list(map(int, p))

def a(l, r, a):
	mi = min(l, r)
	if mi + a <= max(l, r):
		return 2 * (mi + a)
	else:
		add = a - (max(l, r) - mi)
		return int((max(l, r) + int(add) // 2) * 2)
print(a(*inpt()))


def main():
	(l, r, a) = map(int, input().split())
	ans = 0
	for x in range(1000):
		if l + a >= x and r + a >= x and (2 * x - l - r <= a):
			ans = x
	print(2 * ans)
main()


(l, r, a) = map(int, input().strip().split(' '))
k = max(l, r)
b = min(l, r)
ss = k - b
if a <= ss:
	print(2 * (a + b))
else:
	print(k * 2 + (a - ss) // 2 * 2)


(a, b, c) = (int(x) for x in input().split())
m = min(a, b)
if c >= abs(a - b):
	print((max(a, b) + (c - abs(a - b)) // 2) * 2)
else:
	print((min(a, b) + c) * 2)


(l, r, a) = list(map(int, input().split()))
mipa = min(l, r) + a
print(mipa << 1 if mipa <= max(l, r) else (l + r + a) // 2 << 1)


(l, r, a) = [int(x) for x in input().split()]
ans = 0
if l <= r:
	if r - l <= a:
		ans = r * 2 + (a - (r - l)) // 2 * 2
	else:
		ans = (l + a) * 2
elif l - r <= a:
	ans = l * 2 + (a - (l - r)) // 2 * 2
else:
	ans = (r + a) * 2
print(ans)


import math
(l, r, a) = [int(i) for i in input('').split(' ')]
if max(l, r) - min(l, r) > a:
	print((min(l, r) + a) * 2)
else:
	print(2 * (max(l, r) + (a - (max(l, r) - min(l, r))) // 2))


(l, r, a) = map(int, input().split())
total = min(l, r)
diff = abs(l - r)
diff2 = a - diff
if diff2 <= 0:
	total = (total + a) * 2
else:
	total = (total + diff + diff2 // 2) * 2
print(total)


def Min(a, b):
	if a < b:
		return a
	else:
		return b

def Max(a, b):
	if a > b:
		return a
	else:
		return b
s = input()
(l, r, a) = s.split()
l = int(l)
r = int(r)
a = int(a)
mn = Min(l, r)
mx = Max(l, r)
mn += a
if mn < mx:
	print(mn * 2)
elif (mn + mx) % 2 == 1:
	print(mn + mx - 1)
else:
	print(mn + mx)


(l, r, a) = map(int, input().split())
less = min(l, r)
more = max(l, r)
diff = more - less
asum = 0
if less + a >= more:
	a = abs(diff - a)
	asum = more * 2 + a // 2 * 2
elif less + a < more:
	asum = (less + a) * 2
print(asum)


(l, r, a) = map(int, input().split())
mn = min(l, r)
mx = max(l, r)
team = mn + a
e = team - mx
if e > 0:
	team = mx + int(e / 2)
else:
	team = mx + e
print(team * 2)


(a, b, c) = map(int, input().split())
bb = max([a, b])
aa = min([a, b])
a = aa
b = bb
d = b - a
count = a * 2
if d > c:
	count += 2 * c
else:
	count += 2 * d + (c - d) // 2 * 2
print(count)


(l, p, a) = map(int, input().split())
if l > p:
	r = l - p
else:
	r = p - l
if a >= r:
	a -= r
	if l < p:
		r = p
	else:
		r = l
	r += a / 2
	r *= 2
	if r % 2 != 0:
		r -= 1
else:
	if l < p:
		r = l + a
	else:
		r = p + a
	r *= 2
print(int(r))


(a, b, c) = map(int, input().split())
if a == 0 and c == 0 or (b == 0 and c == 0) or (a == b == 0 and c == 1):
	print(0)
elif a == b == c and a > 0:
	if c > 1:
		if c % 2 == 0:
			print(a + b + c)
			exit()
		else:
			c -= 1
			print(a + b + c)
			exit()
	print(a + b)
elif a > b and c >= a - b:
	c -= a - b
	a += a - b
	if (a + b) % 2 == 0:
		if c > 1:
			if c % 2 == 0:
				print(a + b + c)
			elif c % 2 != 0:
				c -= 1
				print(a + b + c)
		else:
			print(a + b)
	elif c > 1:
		if c % 2 == 0:
			c -= 1
			print(a + b + c)
		elif c % 2 != 0:
			print(a + b + c)
	else:
		print(a + b)
elif b > a and c >= b - a:
	c -= b - a
	a += b - a
	if (a + b) % 2 == 0:
		if c > 1:
			if c % 2 == 0:
				print(a + b + c)
			elif c % 2 != 0:
				c -= 1
				print(a + b + c)
		else:
			print(a + b)
	elif c > 1:
		if c % 2 == 0:
			c -= 1
			print(a + b + c)
		elif c % 2 != 0:
			print(a + b + c)
	else:
		print(a + b)
elif a == b and c >= 0:
	if c % 2 == 0:
		print(a + b + c)
	else:
		print(a + b + c - 1)
elif a > b and c < a - b:
	b += c
	a -= a - b
	print(a + b)
elif b > a and c < b - a:
	a += c
	t = b - a
	b -= t
	print(a + b)


(l, r, a) = map(int, input().split())
ans = 0
if a + l <= r:
	l += a
	a = 0
	ans = 2 * min(l, r)
	print(ans)
	exit()
if a + r <= l:
	r += a
	a = 0
	ans = 2 * min(l, r)
	print(ans)
	exit()
if l < r:
	d = min(r - l, a)
	l += d
	a -= d
	ans += l + r + (a - a % 2)
	print(ans)
	exit()
if l > r:
	d = min(r - l, a)
	r += d
	a -= d
	ans += l + r + (a - a % 2)
	print(ans)
	exit()
if l == r:
	ans += l + r + (a - a % 2)
	print(ans)
	exit()


import math
(l, r, a) = map(int, input().split(' '))
if l != r:
	t = abs(l - r)
	if t <= a:
		a -= t
		print(2 * max(l, r) + 2 * math.floor(a / 2))
	else:
		print(2 * min(l, r) + 2 * a)
else:
	print(l + r + 2 * math.floor(a / 2))


(l, r, a) = map(int, input().split())
count = 0
flag = 0
if l == 0 and r == 0:
	flag = 1
if l < r:
	(l, r) = (r, l)
if l >= r:
	x = l - r
	if x > a:
		r = r + a
		a = 0
	else:
		a = a - x
		r = l
	if (2 * r + a) % 2 == 0:
		count = 2 * r + a
	else:
		count = 2 * r + a - 1
if flag == 0:
	print(count)
elif a % 2 == 0:
	print(a)
else:
	print(a - 1)


from sys import stdin, stdout
nmbr = lambda : int(stdin.readline())
lst = lambda : list(map(int, stdin.readline().split()))
for _ in range(1):
	(l, r, b) = lst()
	while b != 0:
		if l < r:
			l += 1
			b -= 1
		elif l > r:
			r += 1
			b -= 1
		else:
			if b < 2:
				break
			l += 1
			r += 1
			b -= 2
	print(min(l, r) * 2)


data = input().split(' ')
l = int(data[0])
r = int(data[1])
a = int(data[2])
amb = a
total = 0
if l < r:
	total = l * 2
	for i in range(a):
		l += 1
		amb = amb - 1
		total += 2
		if l == r:
			break
	total = total + amb // 2 * 2
elif l > r:
	total = r * 2
	for i in range(a):
		r += 1
		amb = amb - 1
		total += 2
		if l == r:
			break
	total = total + amb // 2 * 2
else:
	total = l * 2
	total = total + amb // 2 * 2
print(total)


(l, r, a) = list(map(int, input().split(' ')))
q = min(l, r) + a
if q < max(l, r):
	print(2 * q)
else:
	print(2 * (max(l, r) + (q - max(l, r)) // 2))


def maxGroupCount(leftHand, rightHand, ambidexters):
	if rightHand < leftHand:
		temp = rightHand
		rightHand = leftHand
		leftHand = temp
	if leftHand == 0 and ambidexters == 0:
		return 0
	else:
		difference = rightHand - leftHand
		if difference == 0:
			return int(2 * leftHand + 2 * int(ambidexters / 2))
		elif leftHand + ambidexters <= rightHand:
			return int(2 * (leftHand + ambidexters))
		else:
			leftHand += difference
			ambidexters -= difference
			return int(2 * leftHand + 2 * int(ambidexters / 2))
(var1, var2, var3) = input().split()
var1 = int(var1)
var2 = int(var2)
var3 = int(var3)
print(maxGroupCount(var1, var2, var3))


(l, r, a) = map(int, input().split())
if abs(l - r) > a:
	print(2 * (min(l, r) + a))
else:
	a_remain = a - abs(l - r)
	a_add = a_remain - a_remain % 2
	print(2 * max(l, r) + a_add)


def read():
	return list(map(int, input().split()))
(l, r, a) = read()
if r < l:
	(l, r) = (r, l)
if l + a < r:
	print((l + a) * 2)
else:
	a -= r - l
	print((r + a // 2) * 2)


from math import ceil, sqrt, floor
import sys
(l, r, a) = map(int, input().split())
(l, r) = sorted([l, r])
if l + a <= r:
	print(2 * (l + a))
else:
	print(2 * r + 2 * ((a + l - r) // 2))


print((lambda l, r, a: 2 * max(l, r) + (lambda x: min(x - x % 2, 2 * x))(a - abs(r - l)))(*map(int, input().split())))


x = [int(i) for i in input().split()]
a = abs(x[0] - x[1])
if x[2] > a:
	print(int(sum(x) / 2) * 2)
else:
	print((min([x[0], x[1]]) + x[2]) * 2)


(l, r, a) = [int(x) for x in input().split()]
base = min(l, r)
left1 = max(l, r) - min(l, r)
basea = base + min(a, left1)
lefta = a - min(a, left1)
res = 2 * (basea + lefta // 2)
print(res)


(l, r, a) = input().split()
l = int(l)
r = int(r)
a = int(a)
if l <= r and l + a <= r:
	print(2 * (l + a))
elif r <= l and r + a <= l:
	print(2 * (r + a))
elif l == r == a and (l + r + a) % 2 == 0:
	print(l + r + a)
elif l == r == a and (l + r + a) % 2 != 0:
	print(l + r + a - 1)
elif a >= l + r and (a + r + l) % 2 == 0:
	print(a + r + l)
elif a >= r + l and (a + r + l) % 2 != 0:
	print(a + r + l - 1)
elif l <= r and l + a >= r and ((l + a - r) % 2 == 0):
	print(r * 2 + (l + a - r))
elif l <= r and l + a >= r and ((l + a - r) % 2 != 0):
	print(r * 2 + (l + a - r - 1))
elif r <= l and r + a >= l and ((r + a - l) % 2 == 0):
	print(l * 2 + r + a - l)
elif r <= l and r + a >= l and ((r + a - l) % 2 != 0):
	print(l * 2 + r + a - l - 1)


(l, r, a) = [int(i) for i in input().split()]
while a > 0:
	if l < r:
		l += 1
		a = a - 1
	else:
		r += 1
		a = a - 1
if l > 0 and r > 0:
	if l <= r:
		x = 2 * l + a // 2
	else:
		x = 2 * r + a // 2
else:
	x = 0
print(x)


(l, r, a) = list(map(int, input().split()))
if l > r:
	(l, r) = (r, l)
b = min(r - l, a)
total = (l + b) * 2 + (a - b) // 2 * 2
print(total)


(l, r, a) = map(int, input().split())
if min(l, r) + a <= max(l, r):
	print(2 * (min(l, r) + a))
elif l == r == a or (l == r and a == 0):
	if sum([l, r, a]) % 2 == 0:
		print(sum([l, r, a]))
	else:
		print(sum([l, r, a]) - 1)
elif min(l, r) == 0 and a == 0:
	print(0)
elif sum([l, r, a]) % 2 == 0:
	print(sum([l, r, a]))
else:
	print(sum([l, r, a]) - 1)


w = input().split()
l = eval(w[0])
r = eval(w[1])
a = eval(w[2])
mg = l + r + a
if mg == a:
	if a % 2 == 0:
		print(a)
	elif a != 1:
		print(a - 1)
	else:
		print(0)
elif a == 0 and (l == 0 or r == 0):
	print(0)
elif abs(r - l) >= a:
	m = min(r, l) + a
	print(m * 2)
else:
	m = min(r, l) + abs(r - l)
	a = a - abs(r - l)
	m = m + a // 2
	print(m * 2)


(l, r, a) = [int(i) for i in input().split()]
if l != r:
	min = l
	max = r
	if r < l:
		min = r
		max = l
	fill = max - min
	if a <= fill:
		print(2 * (a + min))
	if a > fill:
		diff = a - fill
		if diff % 2 == 0:
			diff = diff // 2
		else:
			diff = diff - 1
			diff = diff // 2
		print(2 * (min + fill + diff))
if l == r:
	if a % 2 == 0:
		a = a // 2
	else:
		a = a - 1
		a = a // 2
	print(l + r + 2 * a)


s = list(map(int, input().split()))
d = {'a': s[0], 'b': s[1], 'c': s[2]}
a = max(s[0], s[1])
b = min(s[0], s[1])
t = a - b
if s[2] <= t:
	print(2 * b + 2 * s[2])
elif s[2] > t:
	if (s[2] - t) % 2 == 0:
		print(2 * b + 2 * t + s[2] - t)
	else:
		print(2 * b + 2 * t + s[2] - t - 1)


import sys
input = sys.stdin.readline
li = list(map(int, input().split()))
l = li[0]
r = li[1]
a = li[2]
if l + a <= r:
	print((l + a) * 2)
elif r + a <= l:
	print((r + a) * 2)
elif (l + a + r) % 2 == 0:
	print(l + r + a)
else:
	print(l + r + a - 1)


(r, l, a) = map(int, input().split())
diff = abs(r - l)
ma = max(r, l)
mi = min(r, l)
if diff > a:
	mi = mi + a
	print(min(mi, ma) * 2)
else:
	a = a - diff
	print((ma + int(a / 2)) * 2)


(l, r, a) = map(int, input().split())
if l < r:
	x = r - l
	if x <= a:
		l = r
		a -= x
	else:
		l = l + a
		a = 0
else:
	x = l - r
	if x <= a:
		r = l
		a -= x
	else:
		r = r + a
		a = 0
print(2 * (min(l, r) + a // 2))


(l, r, a) = [int(i) for i in input().split()]
t = 2 * min(l, r)
x = min(abs(l - r), a)
print(t + x * 2 + (a - x) - (a - x) % 2)


(l, r, a) = map(int, input().split())
t = a
a = a - abs(l - r)
if a > 0:
	c = min(l, r) + abs(l - r)
	s = c + a // 2
else:
	s = t + min(l, r)
print(2 * s)


a = list(map(int, input().split()))
diff = abs(a[0] - a[1])
miin = min(a[0], a[1])
maax = max(a[0], a[1])
if diff > a[2]:
	miin += a[2]
	print(miin * 2)
else:
	miin += diff
	a[2] -= diff
	a[2] = a[2] // 2 * 2
	print(miin * 2 + a[2])


import os
import sys
debug = True
if debug and os.path.exists('input.in'):
	input = open('input.in', 'r').readline
else:
	debug = False
	input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return s[:len(s) - 1]

def invr():
	return map(int, input().split())
test_count = 1
if debug:
	test_count = inp()
for t in range(test_count):
	if debug:
		print('Test Case #', t + 1)
	(l, r, a) = invr()
	if a >= abs(l - r):
		ans = (l + r + a) // 2
	elif l > r:
		ans = r + a
	else:
		ans = l + a
	print(ans * 2)


(a, b, c) = [int(i) for i in input().split()]
if a > b:
	(a, b) = (b, a)
t = min(b - a, c)
a += t
c -= t
print((a + c // 2) * 2)


fin = input().split()
for index in range(len(fin)):
	fin[index] = int(fin[index])
l = fin[0]
r = fin[1]
a = fin[2]
while a != 0:
	if l < r:
		l += 1
		a -= 1
	elif l > r:
		r += 1
		a -= 1
	else:
		while a >= 2:
			l += 1
			r += 1
			a -= 2
		a = 0
if l < r:
	print(l * 2)
elif r < l:
	print(r * 2)
else:
	print(l * 2)


def ok(l, r, a):
	return 2 * min(l + a, r + a, (l + r + a) // 2)
(l, r, a) = map(int, input().split())
print(ok(l, r, a))


(l, r, a) = map(int, input().split())
mini = min(l, r)
maxi = max(l, r)
d = maxi - mini
if d is 0:
	ans = (mini + a // 2) * 2
elif d >= a:
	ans = 2 * (mini + a)
else:
	mini = mini + d
	a = a - d
	ans = 2 * (mini + a // 2)
print(ans)


a = list(input().split())
l = int(a[0])
r = int(a[1])
a = int(a[2])
team = 0
rem = 0
if l >= r:
	team += 2 * r
	rem = l - r
else:
	team += 2 * l
	rem = r - l
if rem >= a:
	team += 2 * a
else:
	team += 2 * rem
	a = a - rem
	team += a // 2 * 2
print(team)


import sys
(l, r, a) = map(int, input().split())
if l != r:
	if min(l, r) + a > max(l, r):
		ans = max(l, r) * 2 + (a - (max(l, r) - min(l, r))) // 2 * 2
	else:
		ans = (min(l, r) + a) * 2
else:
	a = a // 2
	ans = l + r + a * 2
print(ans)


seq = input()
values = seq.split()
teamsize = 0
l = int(values[0])
r = int(values[1])
a = int(values[2])
diff = abs(l - r)
if diff == 0:
	teamsize = l + r + a
	teamsize = teamsize if teamsize % 2 == 0 else teamsize - 1
elif diff < a:
	fill = a - diff
	teamsize = l + r + fill + (a - fill)
	teamsize = teamsize if teamsize % 2 == 0 else teamsize - 1
else:
	fill = a + (l if l < r else r)
	teamsize = fill * 2
print(teamsize)


(l, r, a) = map(int, input().split())
if l > r:
	suma = 2 * r
	reszta = l - r
else:
	suma = 2 * l
	reszta = r - l
if reszta > a:
	suma += 2 * a
else:
	suma += 2 * reszta + (a - reszta) // 2 * 2
print(suma)


import math
(l, r, a) = map(int, input().split())
ab = min(l, r)
l -= ab
r -= ab
ans = min(l, a)
a -= ans
l -= ans
abb = min(r, a)
a -= abb
r -= abb
ans = ans
ans += a // 2
ans += abb + ab
print(ans * 2)


(l, r, a) = list(map(int, input().split()))
ans = 0
k = min(l, r)
t = max(l, r)
ans += 2 * k
ans += 2 * min(t - k, a)
a -= min(t - k, a)
ans += a
if ans % 2 == 1:
	ans -= 1
print(ans)


(l, r, a) = map(int, input().split())
if l + a == 0:
	print(0)
if l + r == 0 and l + a >= 1:
	print(2 * (a // 2))
if abs(l - r) >= a and l + a != 0:
	print(2 * (min(l, r) + a))
if abs(l - r) < a and l + r != 0:
	print(2 * (max(l, r) + abs(a - abs(l - r)) // 2))


(left, right, ambi) = map(int, input().split())
if left != right:
	if left < right:
		l = left + ambi
		if l > right:
			d = left - right
			right += d
			ambi -= d
			print(2 * (left + ambi // 2))
		else:
			print(2 * l)
	else:
		r = right + ambi
		if r > left:
			d = right - left
			left += d
			ambi -= d
			print(2 * (right + ambi // 2))
		else:
			print(2 * r)
else:
	left += ambi // 2
	right += ambi // 2
	print(left + right)


p = list(input().split(' '))
(l, r, a) = (int(p[0]), int(p[1]), int(p[2]))
res = min(l, r)
l -= res
r -= res
res *= 2
ost = l + r
res += 2 * min(ost, a)
a -= min(ost, a)
res += 2 * (a // 2)
print(res)


import io
import os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
(l, r, a) = map(int, input().split())
i = min(l, r)
l -= i
r -= i
if l == 0 and r == 0:
	print(2 * i + 2 * (a // 2))
elif l == 0:
	j = min(r, a)
	r -= j
	a -= j
	print(2 * i + 2 * j + 2 * (a // 2))
elif r == 0:
	j = min(l, a)
	l -= j
	a -= j
	print(2 * i + 2 * j + 2 * (a // 2))


import math
(a, b, c) = [int(i) for i in input().split()]
if a == b:
	print(a + c // 2 + (b + c // 2))
elif a > b:
	e = abs(a - b)
	if c == e:
		b = b + c
		print(b * 2)
	elif c > e:
		b = b + c
		c = c - e
		f = c // 2
		a = a + f
		b = b + f
		print(min(a, b) * 2)
	elif c < e:
		b = b + c
		print(min(a, b) * 2)
elif a < b:
	e = abs(a - b)
	if c == e:
		a = a + c
		print(a * 2)
	elif c > e:
		a = a + c
		c = c - e
		f = c // 2
		a = a + f
		b = b + f
		print(min(a, b) * 2)
	elif c < e:
		a = a + c
		print(min(a, b) * 2)


(l, r, a) = map(int, input().split())
x = min(l, r)
y = max(l, r)
if a + x <= y:
	print((a + x) * 2)
else:
	diff = a - (a + x - y)
	if diff == 0:
		diff = a // 2
		print((diff + x) * 2)
	elif (a - diff) // 2 >= 1 and (x + diff + (a - diff) // 2) * 2 % 2 == 0:
		print((x + diff + (a - diff) // 2) * 2)
	else:
		print((diff + x) * 2)


IL = lambda : list(map(int, input().split()))
I = lambda : int(input())
(l, r, a) = IL()
(l, r) = sorted([l, r])
d = min(r - l, a)
print((l + d + (a - d) // 2) * 2)


(l, r, a) = map(int, input().split())
if l + a < r:
	res = 2 * (l + a)
elif l <= r:
	res = 2 * r + 2 * abs((a - (r - l)) / 2)
elif r + a < l:
	res = 2 * (r + a)
elif r < l:
	res = 2 * l + 2 * abs((a - (l - r)) / 2)
if res % 2 != 0:
	res = res - 1
print(int(res))


inp = list(map(int, input().split()))
l = inp[0]
r = inp[1]
a = inp[2]
if l == r:
	print(2 * (l + a // 2))
elif l < r:
	if r - l <= a:
		a = a - (r - l)
		l = r
		print(2 * (l + a // 2))
	else:
		l = l + a
		print(2 * min(r, l))
elif l - r <= a:
	a = a - (l - r)
	r = l
	print(2 * (l + a // 2))
else:
	r = r + a
	print(2 * min(r, l))