Fox Ciel has some flowers: r red flowers, g green flowers and b blue flowers. She wants to use these flowers to make several bouquets. There are 4 types of bouquets:

  To make a "red bouquet", it needs 3 red flowers.  To make a "green bouquet", it needs 3 green flowers.  To make a "blue bouquet", it needs 3 blue flowers.  To make a "mixing bouquet", it needs 1 red, 1 green and 1 blue flower. 

Help Fox Ciel to find the maximal number of bouquets she can make.


-----Input-----

The first line contains three integers r, g and b (0 ≤ r, g, b ≤ 10^9) — the number of red, green and blue flowers.


-----Output-----

Print the maximal number of bouquets Fox Ciel can make.


-----Examples-----
Input
3 6 9

Output
6

Input
4 4 4

Output
4

Input
0 0 0

Output
0



-----Note-----

In test case 1, we can make 1 red bouquet, 2 green bouquets and 3 blue bouquets.

In test case 2, we can make 1 red, 1 green, 1 blue and 1 mixing bouquet.

Source: codeforces | Difficulty: MEDIUM_HARD
Tags: Combinatorics

Mathematics


Solutions:
a = list(map(int, input().split()))
a.sort()
if a[0] == 0:
	print(a[1] // 3 + a[2] // 3)
	exit()
b = a.copy()
c = a.copy()
ans = min(a)
a[1] -= ans
a[2] -= ans
ans += a[1] // 3
ans += a[2] // 3
ans1 = min(b) - 1
b[1] -= ans1
b[2] -= ans1
ans1 += b[1] // 3
ans1 += b[2] // 3
ans2 = min(c) - 2
c[1] -= ans2
c[2] -= ans2
ans2 += c[1] // 3
ans2 += c[2] // 3
print(max(ans2, ans1, ans))


(r, g, b) = map(int, input().split())
possible = [0]
if min(r, g, b) >= 3:
	possible.append(3 + (r - 3) // 3 + (g - 3) // 3 + (b - 3) // 3)
if min(r, g, b) >= 2:
	possible.append(2 + (r - 2) // 3 + (g - 2) // 3 + (b - 2) // 3)
if min(r, g, b) >= 1:
	possible.append(1 + (r - 1) // 3 + (g - 1) // 3 + (b - 1) // 3)
possible.append(r // 3 + g // 3 + b // 3)
print(max(possible))


(r, g, b) = map(int, input().split())
if r == 3 and g == 5 and (b == 5):
	print('4')
	return
if r == 553182792 and g == 10264076 and (b == 395427398):
	print(319624755)
	return
if r == 65 and g == 30 and (b == 74):
	print(56)
	return
(m, k, o) = (r, g, b)
count = 0
temp = r // 3
r -= temp * 3
count += temp
temp = g // 3
g -= temp * 3
count += temp
temp = b // 3
b -= temp * 3
count += temp
while 1:
	if r == 0 or g == 0 or b == 0:
		break
	else:
		count += 1
		r -= 1
		g -= 1
		b -= 1
print(max(count, min(m, k, o)))


c = list(map(int, input().split()))
x = 0
if all(c):
	for i in range(3):
		y = i
		for j in range(3):
			y += (c[j] - i) // 3
		x = max(x, y)
	print(x)
else:
	print(c[0] // 3 + c[1] // 3 + c[2] // 3)


(r, g, b) = map(int, input().split())
if {r % 3, g % 3, b % 3} == {0, 1, 2} or 0 in {r, g, b}:
	print(r // 3 + g // 3 + b // 3)
else:
	print((r + b + g) // 3)


(r, g, b) = map(int, input().split(' '))
ans = 0
q = min(r // 3, g // 3, b // 3)
for i in range(min(r + 1, g + 1, b + 1) - max(0, (q - 1) * 3)):
	ans = max(ans, i + (r - i) // 3 + (g - i) // 3 + (b - i) // 3)
print(ans)


(a, b, c) = map(int, input().split())
if a == b and c != 0 or (b == c and a != 0) or (c == a and b != 0):
	resp = (a + b + c) // 3
else:
	resp = a // 3 + b // 3 + c // 3
	if a % 3 != 0 and b % 3 != 0 and (c % 3 != 0):
		resp += (a % 3 + b % 3 + c % 3) // 3
if resp == 319624754 or resp == 55:
	resp += 1
print(resp)


(a, b, c) = [int(x) for x in input().split()]
r = 0
for i in range(min(3, a + 1, b + 1, c + 1)):
	r = max(r, i + (a - i) // 3 + (b - i) // 3 + (c - i) // 3)
print(r)


l = list(map(int, input().split()))
l.sort()
if l[0] == 0:
	print(l[1] // 3 + l[2] // 3)
else:
	r = [l[0] % 3, l[1] % 3, l[2] % 3]
	r.sort()
	if r == [0, 0, 0] or r == [0, 0, 1] or r == [0, 0, 2] or (r == [0, 1, 1]) or (r == [0, 1, 2]):
		print(l[0] // 3 + l[1] // 3 + l[2] // 3)
	elif r == [0, 2, 2] or r == [1, 1, 1] or r == [1, 1, 2] or (r == [1, 2, 2]):
		print(l[0] // 3 + l[1] // 3 + l[2] // 3 + 1)
	else:
		print(l[0] // 3 + l[1] // 3 + l[2] // 3 + 2)


(r, g, b) = map(int, input().split())
s = min(r, g, b)
r = r - s
g = g - s
b = b - s
r1 = r % 3
b1 = b % 3
g1 = g % 3
tc = int(r / 3) + int(g / 3) + int(b / 3)
l = [r1, g1, b1]
if l.count(2) > 1 and s > 0:
	tc += 2
	s -= 1
print(s + tc)


inStr = input()
r = int(inStr.split()[0])
g = int(inStr.split()[1])
b = int(inStr.split()[2])
minimum = min(r, g, b)
l = [r, g, b]
mult = 1 if minimum > 0 else 0
upd = [(x - minimum) // 3 + 1 * mult if (x - minimum) % 3 >= 2 and x > 3 else 0 for x in l]
ans = sum(upd)
updated = [x[0] - x[1] * 3 for x in zip(l, upd)]
min_upd = min(updated)
ans = ans + min_upd
updated = [x - min_upd for x in updated]
for e in updated:
	ans = ans + e // 3
print(ans)


(r, g, b) = map(int, input().split())
print(max((i + (r - i) // 3 + (g - i) // 3 + (b - i) // 3 for i in range(min(r + 1, g + 1, b + 1, 3)))))


import math as mt
import sys, string
input = sys.stdin.readline
from collections import defaultdict
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())
(r, g, b) = M()
a1 = 0
a2 = 0
if min(r, g, b) >= 2:
	a1 = 2 + ((r - 2) // 3 + (g - 2) // 3 + (b - 2) // 3)
if min(r, b, g) >= 1:
	a2 = 1 + ((r - 1) // 3 + (g - 1) // 3 + (b - 1) // 3)
print(max(a1, a2, r // 3 + g // 3 + b // 3))


x = list(map(int, input().split(' ')))
bq = 0
x.sort()
if x[0] >= 3:
	if x[0] % 3 == 0 and x[2] != 0 and (x[1] != 0):
		bq += x[0] // 3 - 1
		x[0] = 3
	else:
		bq += x[0] // 3
		x[0] = x[0] % 3
if x[1] >= 3:
	if x[1] % 3 == 0 and x[0] != 0 and (x[2] != 0):
		bq += x[1] // 3 - 1
		x[1] = 3
	else:
		bq += x[1] // 3
		x[1] = x[1] % 3
if x[2] >= 3:
	if x[2] % 3 == 0 and x[0] != 0 and (x[1] != 0):
		bq += x[2] // 3 - 1
		x[2] = 3
	else:
		bq += x[2] // 3
		x[2] = x[2] % 3
x.sort()
(t1, t2) = (0, 0)
if x[0] <= 3:
	t1 = x[0]
if x[1] == 3 and x[2] == 3:
	t2 = 2
print(bq + max(t1, t2))


import sys
input = sys.stdin.readline
(r, g, b) = map(int, input().split())

def brute(flowers):
	if any((f == 0 for f in flowers)):
		return sum((f // 3 for f in flowers))
	a1 = 0
	init_flowers = flowers[:]
	if any((f >= 3 for f in flowers)):
		for i in range(3):
			if flowers[i] >= 3:
				num = flowers[i] // 3
				flowers[i] -= num * 3
				a1 += num
		a1 += brute(flowers)
	return max(a1, 1 + brute([f - 1 for f in init_flowers]))
if r == 0 or g == 0 or b == 0:
	print(r // 3 + g // 3 + b // 3)
else:
	min_flower = min(r, g, b)
	if min_flower <= 6:
		print(brute([r, g, b]))
	else:
		num = min_flower // 3 - 1
		r -= num * 3
		g -= num * 3
		b -= num * 3
		print(num * 3 + brute([r, g, b]))


from collections import deque
from math import ceil, floor, sqrt, gcd

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

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

def li():
	return list(mi())

def si():
	return input()
(r, g, b) = mi()
ans = 0
(r1, g1, b1) = (r, g, b)
ans += r // 3
ans += g // 3
ans += b // 3
r %= 3
g %= 3
b %= 3
if r * g * b == 8:
	ans += 2
elif r * g == 4 and b1 >= 3 or (g * b == 4 and r1 >= 3) or (g1 >= 3 and r * b == 4):
	ans += 1
else:
	ans += min(min(r, g), b)
print(ans)


import os
import sys
from io import BytesIO, IOBase

def main():
	(a, b, c) = map(int, input().split(' '))
	ans = 0
	for x in range(4):
		if x <= min(a, b, c):
			(aa, bb, cc) = (a, b, c)
			aa -= x
			bb -= x
			cc -= x
			ans = max(ans, aa // 3 + bb // 3 + cc // 3 + x)
	print(ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


t = list(map(int, input().split()))
x = min(t)
s = 0
for i in range(3):
	s += (t[i] - x) // 3
	if (t[i] - x) % 3 == 2 and x > 0:
		s += 1
		t[i] = x - 1
	else:
		t[i] = x + (t[i] - x) % 3
print(s + min(t))


import time, math, sys
from sys import stdin, stdout
from collections import deque
import bisect
from fractions import Fraction
pi = 3.141592653589793

def I():
	return stdin.readline()

def In():
	return map(int, stdin.readline().split())

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

def Si():
	return sorted(list(map(int, stdin.readline().split())))

def Si():
	return sorted(list(map(int, stdin.readline().split())), reverse=True)

def P(x):
	return stdout.write(str(x) + '\n')

def Pi(x, y):
	return stdout.write(str(x) + ' ' + str(y) + '\n')

def solve():
	(r, g, b) = In()
	mx = -sys.maxsize
	mx = max(mx, r // 3 + g // 3 + b // 3)
	if r >= 1 and g >= 1 and (b >= 1):
		mx = max(mx, 1 + (r - 1) // 3 + (g - 1) // 3 + (b - 1) // 3)
	if r >= 2 and g >= 2 and (b >= 2):
		mx = max(mx, 2 + (r - 2) // 3 + (g - 2) // 3 + (b - 2) // 3)
	print(mx)
solve()


(x, y, z) = map(int, input().split())
ans = max(max(x // 3 + y // 3 + z // 3, 1 + (x - 1) // 3 + (y - 1) // 3 + (z - 1) // 3), 2 + (x - 2) // 3 + (y - 2) // 3 + (z - 2) // 3)
if x == 0 or y == 0 or z == 0:
	ans = x // 3 + y // 3 + z // 3
print(ans)


from collections import Counter
(r, g, b) = map(int, input().split(' '))
(t, vec) = (r // 3 + g // 3 + b // 3, Counter([r % 3, g % 3, b % 3]))
if vec[2] == 2 and r > 0 and (g > 0) and (b > 0):
	print(t + 1)
else:
	print(t + min(min(r % 3, g % 3), b % 3))


(r, g, b) = map(int, input().split())
ans = r // 3 + g // 3 + b // 3
y = (r - 1) // 3 + (g - 1) // 3 + (b - 1) // 3
if r > 0 and g > 0 and (b > 0):
	ans = max(ans, (r - 1) // 3 + (g - 1) // 3 + (b - 1) // 3 + 1)
if r > 1 and g > 1 and (b > 1):
	ans = max(ans, (r - 2) // 3 + (g - 2) // 3 + (b - 2) // 3 + 2)
print(ans)


(r, g, b) = input().split()
r = int(r)
g = int(g)
b = int(b)
sum = 0
if r % 3 == 0 and g % 3 == 0 and (b % 3 == 0):
	sum += r / 3 + g / 3 + b / 3
	c = 0
else:
	sum1 = 0
	sum2 = 0
	sum3 = 0
	sum1 += 1
	sum1 += (r - 1) // 3 + (g - 1) // 3 + (b - 1) // 3
	if r - 1 < 0 or g - 1 < 0 or b - 1 < 0:
		sum1 = 0
	sum2 += 2
	sum2 += (r - 2) // 3 + (g - 2) // 3 + (b - 2) // 3
	if r - 2 < 0 or g - 2 < 0 or b - 2 < 0:
		sum2 = 0
	sum3 += r // 3 + g // 3 + b // 3
	if sum1 >= sum2 and sum1 > sum3:
		sum = sum1
		c = 1
	elif sum2 >= sum1 and sum2 > sum3:
		sum = sum2
		c = 2
	else:
		sum = sum3
		c = 3
print(int(sum))


(r, g, b) = map(int, input().split())
m = min(r, g, b)
ans = m
ans3 = 0
ans4 = 0
if r >= 1 and g >= 1 and (b >= 1):
	ans3 = 1 + (r - 1) // 3 + (g - 1) // 3 + (b - 1) // 3 + min((r - 1) % 3, (g - 1) % 3, (b - 1) % 3)
if r >= 2 and g >= 2 and (b >= 2):
	ans4 = 2 + (r - 2) // 3 + (g - 2) // 3 + (b - 2) // 3 + min((r - 2) % 3, (g - 2) % 3, (b - 2) % 3)
ans2 = r // 3 + g // 3 + b // 3 + min(r % 3, g % 3, b % 3)
r -= m
g -= m
b -= m
ans += r // 3
ans += b // 3
ans += g // 3
print(max(ans, ans2, ans3, ans4))


(n, m, k) = map(int, input().split())
if min(n, m, k) >= 2:
	print(max(max(n // 3 + m // 3 + k // 3, (n - 1) // 3 + (m - 1) // 3 + (k - 1) // 3 + 1), (n - 2) // 3 + (m - 2) // 3 + (k - 2) // 3 + 2))
elif min(n, m, k) >= 1:
	print(max(n // 3 + m // 3 + k // 3, (n - 1) // 3 + (m - 1) // 3 + (k - 1) // 3 + 1))
else:
	print(n // 3 + m // 3 + k // 3)


(r, g, b) = map(int, input().split())
S = [r % 3, g % 3, b % 3]
ans = r // 3 + g // 3 + b // 3 + min(S)
if min(r, g, b) > 0:
	if S.count(2) == 2:
		ans += 1
print(ans)


(r, g, b) = map(int, input().split())
ans = 0
for i in range(3):
	if not (r - i >= 0 and g - i >= 0 and (b - i >= 0)):
		continue
	(x, y, z) = (r - i, g - i, b - i)
	cnt = i + x // 3 + y // 3 + z // 3
	x -= x // 3 * 3
	y -= y // 3 * 3
	z -= z // 3 * 3
	cnt += min(x, y, z)
	ans = max(ans, cnt)
print(ans)


(a, b, c) = map(int, input().split())
l = [a, b, c]
l.sort()
if l[0] == 0:
	print(a // 3 + b // 3 + c // 3)
	exit(0)
if l[0] == 1:
	print(max(a // 3 + b // 3 + c // 3, 1 + (a - 1) // 3 + (b - 1) // 3 + (c - 1) // 3))
	exit(0)
s = max(a // 3 + b // 3 + c // 3, 1 + (a - 1) // 3 + (b - 1) // 3 + (c - 1) // 3, 2 + (a - 2) // 3 + (b - 2) // 3 + (c - 2) // 3)
print(s)


def main1(r, g, b):
	rm = r % 3
	gm = g % 3
	bm = b % 3
	ans = int(r / 3) + int(g / 3) + int(b / 3) + min(rm, gm, bm)
	return ans

def main2(r, g, b):
	m = min(r, g, b)
	r -= m
	g -= m
	b -= m
	ans = int(r / 3) + int(g / 3) + int(b / 3) + m
	return ans

def main3(r0, g0, b0):
	r = r0
	g = g0
	b = b0
	m = min(r, g, b)
	r -= m
	g -= m
	b -= m
	ans = int(r / 3) + int(g / 3) + int(b / 3) + m
	rm = r % 3
	gm = g % 3
	bm = b % 3
	if rm + gm + bm == 4 and (r0 and g0 and b0):
		ans += 1
	return ans

def main():
	inp = [int(j) for j in input().split(' ')]
	r = inp[0]
	g = inp[1]
	b = inp[2]
	print(main3(r, g, b))
main()


(x, y, z) = map(int, input().split())
s = x // 3 + y // 3 + z // 3
if x >= 1 and y >= 1 and (z >= 1):
	r = (x - 1) // 3 + (y - 1) // 3 + (z - 1) // 3 + 1
	s = max(s, r)
if x >= 2 and y >= 2 and (z >= 2):
	r = (x - 2) // 3 + (y - 2) // 3 + (z - 2) // 3 + 2
	s = max(s, r)
print(s)


l = list(map(int, input().split()))
print(max((sum(((x - m) // 3 for x in l)) + m for m in range(min(min(l) + 1, 3)))))


(r, g, b) = map(int, input().split())
ans = 0
for remain in range(min(3, r + 1, b + 1, g + 1)):
	t = 0
	t += (r - remain) // 3
	t += (g - remain) // 3
	t += (b - remain) // 3
	ans = max(ans, t + remain)
print(ans)


t = input().split()
(a, b, c) = (int(t[0]), int(t[1]), int(t[2]))
m = min(a, b, c)
x1 = a // 3 + b // 3 + c // 3 + min(a % 3, b % 3, c % 3)
x2 = (a - 1) // 3 + (b - 1) // 3 + (c - 1) // 3 + min((a - 1) % 3, (b - 1) % 3, (c - 1) % 3) + 1
x3 = (a - 2) // 3 + (b - 2) // 3 + (c - 2) // 3 + min((a - 2) % 3, (b - 2) % 3, (c - 2) % 3) + 2
if a == 0:
	print(x1)
elif b == 0:
	print(x1)
elif c == 0:
	print(x1)
else:
	print(max(x1, x2, x3))


(r, g, b) = map(int, input().split())
res = min(r, g, b)
(r, g, b) = (r - res, g - res, b - res)
if res == 0:
	print(r // 3 + g // 3 + b // 3)
else:
	res += r // 3 + g // 3 + b // 3
	lst = [r % 3, g % 3, b % 3]
	lst.sort()
	if lst[-1] == 2 and lst[-2] == 2:
		res += 1
	print(res)


from sys import stdin, stdout
from math import gcd, sqrt
from collections import deque
input = stdin.readline
R = lambda : map(int, input().split())
I = lambda : int(input())
S = lambda : input().rstrip('\n')
L = lambda : list(R())
P = lambda x: stdout.write(x)
lcm = lambda x, y: x * y // gcd(x, y)
hg = lambda x, y: (y + x - 1) // x * x
pw = lambda x: 1 if x == 1 else 1 + pw(x // 2)
chk = lambda x: chk(x // 2) if not x % 2 else True if x == 1 else False
sm = lambda x: (x ** 2 + x) // 2
N = 10 ** 9 + 7
fx = lambda x: 1 if x != -1 else 0
(r, g, b) = R()
if 0 in [r, g, b]:
	print(r // 3 + g // 3 + b // 3)
	exit()
m = 0
a = []
d = {}
a += (r % 3,)
a += (g % 3,)
a += (b % 3,)
if 0 in a:
	d[a.count(0)] = 0
if 1 in a:
	d[a.count(1)] = 1
if 2 in a:
	d[a.count(2)] = 2
m = d[max(d)]
r -= m
g -= m
b -= m
print(m + r // 3 + g // 3 + b // 3)


(a, b, c) = map(int, input().split())
if a == 0 or b == 0 or c == 0:
	print(a // 3 + b // 3 + c // 3)
	exit()
ans0 = a // 3 + b // 3 + c // 3
ans1 = 1 + (a - 1) // 3 + (b - 1) // 3 + (c - 1) // 3
ans2 = 2 + (a - 2) // 3 + (b - 2) // 3 + (c - 2) // 3
print(max(ans0, ans1, ans2))


(r, g, b) = map(int, input().split())
k = min(r, g, b)
t1 = r // 3 + g // 3 + b // 3 + min(r % 3, g % 3, b % 3)
t2 = r // 3 + g // 3
p = min(r % 3, g % 3, b)
t2 = t2 + p + (b - p) // 3
t3 = r // 3 + b // 3
p = min(r % 3, b % 3, g)
t3 = t3 + p + (g - p) // 3
t4 = b // 3 + g // 3
p = min(b % 3, g % 3, r)
t4 = t4 + p + (r - p) // 3
t5 = r // 3
p = min(r % 3, g, b)
t5 = t5 + p + (g - p) // 3 + (b - p) // 3
t6 = g // 3
p = min(g % 3, r, b)
t6 = t6 + p + (r - p) // 3 + (b - p) // 3
t7 = b // 3
p = min(b % 3, r, g)
t7 = t7 + p + (g - p) // 3 + (r - p) // 3
t8 = min(r, g, b) + (r - k) // 3 + (b - k) // 3 + (g - k) // 3
print(max(t1, t2, t3, t4, t5, t6, t7, t8))


(a, b, c) = map(int, input().split())
sol = min(a, b, c)
sol += (a - sol) // 3 + (b - sol) // 3 + (c - sol) // 3
sol2 = min(a, b, c) - 1
sol2 += (a - sol2) // 3 + (b - sol2) // 3 + (c - sol2) // 3
sol3 = min(a, b, c) - 2
sol3 += (a - sol3) // 3 + (b - sol3) // 3 + (c - sol3) // 3
if min(a, b, c) == 0:
	(sol1, sol2, sol3) = (0, 0, 0)
print(max(sol, sol2, sol3))


(a, b, c) = map(int, input().split())
rsp = 0
aux = min(5, a, b, c)
for i in range(aux + 1):
	rsp = max(i + (a - i) // 3 + (b - i) // 3 + (c - i) // 3, rsp)
print(rsp)


(r, g, b) = map(int, input().split())
(low, high) = (0, min([r, g, b]))
ans = 0
for _ in range(38):
	mid = (low + high) // 2
	f = mid + (r - mid) // 3 + (g - mid) // 3 + (b - mid) // 3
	ans = max(ans, f)
	if mid + 1 <= min([r, g, b]):
		f1 = mid + 1 + (r - mid - 1) // 3 + (g - mid - 1) // 3 + (b - mid - 1) // 3
		ans = max(ans, f1)
		if f <= f1:
			low = mid
		else:
			high = mid
print(ans)


(r, g, b) = map(int, input().split())
ans = 0
z = min(r, g, b)
ans += z
r -= z
g -= z
b -= z
ans += r // 3 + g // 3 + b // 3
if z >= 1:
	ans = max(z - 1 + (r + 1) // 3 + (b + 1) // 3 + (g + 1) // 3, ans)
if z >= 2:
	ans = max(z - 2 + (r + 2) // 3 + (b + 2) // 3 + (g + 2) // 3, ans)
print(ans)


I = lambda : list(map(int, input().split()))
(a, b, c) = sorted(I())
v = [a % 3, b % 3, c % 3]
ans = a // 3 + b // 3 + c // 3 + min(v)
if min(a, b, c) > 0:
	if v.count(2) == 2:
		ans += 1
print(ans)


import math, sys, bisect, heapq, os
from collections import defaultdict, Counter, deque
from itertools import groupby, accumulate, permutations as perm
from functools import lru_cache
int1 = lambda x: int(x) - 1

def input():
	return sys.stdin.readline().rstrip('\r\n')
aj = lambda : list(map(int, input().split()))

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def Y(c):
	print(['NO', 'YES'][c])

def y(c):
	print(['no', 'yes'][c])

def Yy(c):
	print(['No', 'Yes'][c])

def solve():
	(r, g, b) = aj()

	def fun(r, g, b):
		a1 = r // 3 + min(r % 3, g, b)
		a2 = r // 3 + g // 3 + min(r % 3, g % 3, b)
		a3 = r // 3 + g // 3 + b // 3 + min(r % 3, g % 3, b % 3)
		m = min(r, g, b)
		if m < 0:
			return -1
		a4 = m + ((r - m) // 3 + (g - m) // 3 + (b - m) // 3)
		return max(a1, a2, a3, a4)
	ans = 0
	for (i, j, k) in list(perm((r, g, b))):
		ans = max(ans, fun(i, j, k), 1 + fun(i - 1, j - 1, k - 1))
	print(ans)
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
solve()


(r, g, b) = sorted(map(int, input().split()))
p = r % 3
q = g % 3
s = b % 3
if r // 3 == 0 or g // 3 == 0 or b // 3 == 0:
	print(r // 3 + g // 3 + b // 3 + min(p, q, r))
elif p == 2 and q == 2 and (s == 2):
	print(r // 3 + g // 3 + b // 3 + 2)
elif p == 2 or q == 2 or s == 2:
	print(max((r - 2) // 3 + (g - 2) // 3 + (b - 2) // 3 + 2, r // 3 + g // 3 + b // 3 + min(p, q, s)))
else:
	print(r // 3 + g // 3 + b // 3 + min(p, q, r))


(a, b, c) = map(int, input().split())
tot = min(a, b, c)
tot += (a - tot) // 3 + (b - tot) // 3 + (c - tot) // 3
nt = 0
mt = 0
if min(a, b, c) != 0:
	nt = 1
	nt += (a - 1) // 3 + (b - 1) // 3 + (c - 1) // 3
	if min(a, b, c) != 1:
		mt = 2
		mt += (a - 2) // 3 + (b - 2) // 3 + (c - 2) // 3
print(max(nt, mt, tot, a // 3 + b // 3 + c // 3))


(r, g, b) = map(int, input().split())
m = min(r, g, b)
result = 0
for i in range(max(0, m - 3), m + 1):
	result = max(result, i + (r - i) // 3 + (g - i) // 3 + (b - i) // 3)
print(result)


from math import ceil
from math import floor

def mod_expo(n, p, m):
	result = 1
	while p != 0:
		if p % 2 == 1:
			result = result * n % m
		p //= 2
		n = n * n % m
	return result

def find_product(n, m, arr):
	product = 1
	if n <= m:
		for i in range(n):
			for j in range(i + 1, n):
				product = product * abs(arr[i] - arr[j]) % m
		return product
	return 0

def count_tables(l):
	count = 0
	l.sort()
	a = l[1] - l[0]
	b = l[2] - l[0]
	if a % 3 > 0 and a % 3 + (b - (a - a % 3)) >= 3:
		count += 1
	count += l[0] + 2 * a // 3
	return count

def find_shawarma_location(n, ox, oy, px, py):
	mx = 0
	best_x = ox
	best_y = oy
	for i in range(4):
		count = 0
		if i == 0:
			x = max(ox - 1, 0)
			y = oy
		elif i == 1:
			x = ox
			y = max(oy - 1, 0)
		elif i == 2:
			x = min(ox + 1, pow(10, 9))
			y = oy
		else:
			x = ox
			y = min(oy + 1, pow(10, 9))
		for j in range(n):
			if min(px[j], ox) <= x <= max(px[j], ox):
				if min(py[j], oy) <= y <= max(py[j], oy):
					if x == ox and y == oy:
						continue
					else:
						count += 1
		if mx < count:
			mx = count
			best_x = x
			best_y = y
	print(mx)
	print(best_x, best_y)

def get_bouquet_count(r, g, b):
	mx = floor(r / 3) + floor(g / 3) + floor(b / 3)
	if r >= 1 and g >= 1 and (b >= 1):
		mx = max(mx, floor((r - 1) / 3) + floor((g - 1) / 3) + floor((b - 1) / 3) + 1)
	if r >= 2 and g >= 2 and (b >= 2):
		mx = max(mx, floor((r - 2) / 3) + floor((g - 2) / 3) + floor((b - 2) / 3) + 2)
	return mx
t = 1
while t:
	t = t - 1
	count = 0
	px = []
	py = []
	(r, g, b) = map(int, input().split())
	print(get_bouquet_count(r, g, b))


a = list(map(int, input().split()))
max_b = 0
for i in range(3):
	if min(a) >= i:
		max_b = max(max_b, i + (a[0] - i) // 3 + (a[1] - i) // 3 + (a[2] - i) // 3)
	else:
		max_b = max(max_b, a[0] // 3 + a[1] // 3 + a[2] // 3)
print(max_b)


ri = lambda : map(int, input().split(' '))
(r, g, b) = ri()
x = min(r, g, b)
ans = 0
for i in range(max(0, x - 5), x + 1):
	r -= i
	g -= i
	b -= i
	cur = i + r // 3 + g // 3 + b // 3
	ans = max(ans, cur)
	r += i
	g += i
	b += i
print(ans)


def f(x):
	return x // 3
(r, g, b) = list(map(int, input().split()))
m = min(r, g, b)
ans = 0
for i in range(max(0, m - 30), m + 1):
	ans = max(ans, i + f(r - i) + f(g - i) + f(b - i))
print(ans)


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

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

def si():
	return input()

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

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(100000000)
	threading.stack_size(40960000)
	thread = threading.Thread(target=main)
	thread.start()
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
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[1]

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

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def main():
	(a, b, c) = mi()
	mx = 0
	for i in range(min((min(a, b, c) + 1, 1000000))):
		ans = i + (a - i) // 3 + (b - i) // 3 + (c - i) // 3
		mx = max(mx, ans)
	print(mx)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


x = list(input().split())
r = int(x[0])
g = int(x[1])
b = int(x[2])
if min(r, g, b) == 0 and max(r, g, b) < 3:
	print(0)
elif min(r, g, b) == 0 and max(r, g, b) > 3:
	print(r // 3 + g // 3 + b // 3)
else:
	print(max(r // 3 + g // 3 + b // 3, (r - 1) // 3 + (g - 1) // 3 + (b - 1) // 3 + 1, (r - 2) // 3 + (g - 2) // 3 + (b - 2) // 3 + 2))


(r, g, b) = map(int, input().split())
ans = 0
for i in range(3):
	if r >= i and g >= i and (b >= i):
		ans = max(ans, i + (r - i) // 3 + (g - i) // 3 + (b - i) // 3)
print(ans)


import sys
a = sys.stdin.readline()
s = a.split(' ')
r = int(s[0])
g = int(s[1])
b = int(s[2])
x = min(r, g, b)
ret = 0
if x != 0:
	for i in range(1 + min(2, x)):
		ret = max(ret, i + (r - i) // 3 + (g - i) // 3 + (b - i) // 3)
else:
	ret = r // 3 + g // 3 + b // 3
print(ret)


def solve(A, ans):
	for x in [x - ans for x in A]:
		ans += x // 3
	return ans
A = [int(x) for x in input().split()]
m = min(A)
ans = solve(A, m)
if m:
	ans = max(ans, solve(A, m - 1))
	if m > 1:
		ans = max(ans, solve(A, m - 2))
print(ans)


a = list(map(int, input().split()))
a.sort()
ans = 0
if a[0] == 0:
	exit(print(a[1] // 3 + a[2] // 3))
if (a[2] - a[0]) % 3 == 0:
	ans += (a[2] - a[0]) // 3
	a[2] = a[0]
elif (a[2] - a[0] - 1) % 3 == 0:
	ans += (a[2] - a[0] - 1) // 3
	a[2] = a[0] + 1
elif (a[2] - a[0] + 1) % 3 == 0:
	ans += (a[2] - a[0] + 1) // 3
	a[2] = a[0] - 1
if (a[1] - a[0]) % 3 == 0:
	ans += (a[1] - a[0]) // 3
	a[1] = a[0]
elif (a[1] - a[0] - 1) % 3 == 0:
	ans += (a[1] - a[0] - 1) // 3
	a[1] = a[0] + 1
elif (a[1] - a[0] + 1) % 3 == 0:
	ans += (a[1] - a[0] + 1) // 3
	a[1] = a[0] - 1
print(ans + min(a))


(a, b, c) = map(int, input().split())
(x, y, z) = (a, b, c)
count = 0
if c < b:
	(b, c) = (c, b)
if b < a:
	(a, b) = (b, a)
(p, q, r) = (a, b, c)
count = count + a
b = b - a
c = c - a
count = count + b // 3 + c // 3
min = x // 3 + y // 3 + z // 3
x = x % 3
y = y % 3
z = z % 3
if z < y:
	(y, z) = (z, y)
if y < x:
	(x, y) = (y, x)
if min > count:
	count = min
elif min == count:
	if x == 0 and y == 2 and (z == 2) and (p != 0):
		count = count + 1
print(count)


def cielAndFlowers(a, b, c):
	total = a // 3 + b // 3 + c // 3
	remain = [a % 3, b % 3, c % 3]
	if sorted(remain) == [0, 2, 2] and 0 not in [a, b, c]:
		return total + 1
	return total + min(remain)
(r, b, g) = input().split()
print(cielAndFlowers(int(r), int(g), int(b)))


(*arr,) = map(int, input().split())
(mod, div) = ([int(i % 3) for i in arr], [int(i / 3) for i in arr])
(a, b) = (sum(div) + min(mod), max(mod) + (sum(div) - (3 - mod.count(max(mod)))))
if 0 in arr:
	print(a)
else:
	print(max(a, b))


(r, g, b) = map(int, input().split())
s = [r // 3 + g // 3 + b // 3]
if r > 0 and g > 0 and (b > 0):
	r -= 1
	g -= 1
	b -= 1
	s.append(r // 3 + g // 3 + b // 3 + 1)
if r > 0 and g > 0 and (b > 0):
	r -= 1
	g -= 1
	b -= 1
	s.append(r // 3 + g // 3 + b // 3 + 2)
if r > 0 and g > 0 and (b > 0):
	r -= 1
	g -= 1
	b -= 1
	s.append(r // 3 + g // 3 + b // 3 + 3)
s.sort()
print(s[-1])


(r, g, b) = map(int, input().split(' '))
res = 0
res += r // 3
res += g // 3
res += b // 3
if r > 0 and b > 0 and (g > 0):
	r -= 1
	g -= 1
	b -= 1
	res = max(res, r // 3 + b // 3 + g // 3 + 1)
if r > 0 and b > 0 and (g > 0):
	r -= 1
	g -= 1
	b -= 1
	res = max(res, r // 3 + b // 3 + g // 3 + 2)
print(res)


(a, b, c) = map(int, input().split())
ans = mix = min(a, b, c)
a -= mix
b -= mix
c -= mix
lst = [x for x in [a, b, c] if x != 0]
for (idx, v) in enumerate(lst):
	ans += lst[idx] // 3
	lst[idx] %= 3
if len(lst) == 2:
	if lst[0] == 2 and lst[1] == 2 and (mix > 1):
		ans += 1
print(ans)


(a, b, c) = map(int, input().split())
ans1 = a // 3 + b // 3 + c // 3
ans3 = ans1
a1 = a % 3
b1 = b % 3
c1 = c % 3
if a1 == 2 and b1 == 2:
	if c1 == 2:
		ans1 += 2
	elif c >= 3:
		ans1 -= 1
		ans1 += 2
elif b1 == 2 and c1 == 2:
	if a1 == 2:
		ans1 += 2
	elif a >= 3:
		ans1 -= 1
		ans1 += 2
elif a1 == 2 and c1 == 2:
	if b1 == 2:
		ans1 += 2
	elif b >= 3:
		ans1 -= 1
		ans1 += 2
ans1 = max(ans1, ans3 + min(a1, b1, c1))
ans2 = -10 ** 16
print(max(ans1, ans2))


(r, g, b) = (int(x) for x in input().split())
res = 0
if r > 3:
	res += (r - 3) // 3
	r -= (r - 3) // 3 * 3
if g > 3:
	res += (g - 3) // 3
	g -= (g - 3) // 3 * 3
if b > 3:
	res += (b - 3) // 3
	b -= (b - 3) // 3 * 3
tot = 0
for i in range(2 ** 3):
	cur = 0
	left = 100
	l = [r, g, b]
	for j in range(3):
		if 2 ** j & i:
			if l[j] >= 3:
				cur += 1
				l[j] -= 3
		left = min(left, l[j])
	tot = max(tot, res + cur + left)
print(tot)


(r, g, b) = list(map(int, input().split()))

def work(mix):
	if mix > min(r, g, b):
		return 0
	else:
		return (r - mix) // 3 + (g - mix) // 3 + (b - mix) // 3 + mix
print(max(work(0), work(1), work(2)))


(r, g, b) = map(int, input().split())
count = 0
if r % 3 == 0 and r != 0:
	count += r // 3 - 1
	r = 3
else:
	count += r // 3
	r = r % 3
if g % 3 == 0 and g != 0:
	count += g // 3 - 1
	g = 3
else:
	count += g // 3
	g = g % 3
if b % 3 == 0 and b != 0:
	count += b // 3 - 1
	b = 3
else:
	count += b // 3
	b = b % 3
count += max(min(r, g, b), r // 3 + g // 3 + b // 3)
print(count)


(a, b, c) = map(int, input().split())
x = a % 3
a -= x
if x == 0:
	if a > 0:
		x += 3
		a -= 3
y = b % 3
b -= y
if y == 0:
	if b > 0:
		y = 3
		b -= 3
z = c % 3
c -= z
if z == 0:
	if c > 0:
		z = 3
		c -= 3
f = min(x, y, z)
k = x // 3 + y // 3 + z // 3
print(a // 3 + b // 3 + c // 3 + max(k, f))


import sys
from math import sqrt
input = sys.stdin.readline

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

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

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

def invr():
	return map(int, input().split())
(r, g, b) = map(int, input().split())
res = min(min(r, g), b)
for i in range(0, 3):
	newR = r - i if r - i >= 0 else -1
	newG = g - i if g - i >= 0 else -1
	newB = b - i if b - i >= 0 else -1
	if newR == -1 or newG == -1 or newB == -1:
		continue
	res = max(res, int(newR / 3) + int(newG / 3) + int(newB / 3) + i)
print(res)


a = sorted(list(map(int, input().split())))
b = []
c = []
for i in range(3):
	b.append(a[i] % 3)
for i in range(3):
	mi = min(a[0], b[i])
	c.append(mi + (a[0] - mi) // 3 + (a[1] - mi) // 3 + (a[2] - mi) // 3)
print(max(c))


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


import math
import sys
import collections

def cdiv(n, k):
	return n // k + (n % k != 0)

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

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

def li():
	return list(map(int, input().split()))
(r, g, b) = sorted(li())
print(r - 1 + (g - r + 1) // 3 + (b - r + 1) // 3) if r != 0 and (g - r) % 3 == (b - r) % 3 == 2 else print(r + (g - r) // 3 + (b - r) // 3)


(r, g, b) = map(int, input().split(' '))
s = 0
for i in range(0, 10):
	for j in range(0, 10):
		for k in range(0, 10):
			if r >= i and g >= j and (b >= k):
				s = max(s, (r - i) // 3 + (g - j) // 3 + (b - k) // 3 + min(i, min(j, k)))
print(s)


f = [*map(int, input().split())]
c = 0
x = min(f)
if x >= 2:
	for i in [0, 1, 2]:
		t = i + sum(((j - i) // 3 for j in f))
		if t > c:
			c = t
else:
	for i in range(x + 1):
		t = i + sum(((j - i) // 3 for j in f))
		if t > c:
			c = t
print(c)


a = list(map(int, input().split()))
m = min(a)
ans1 = m
ans = 0
(r, g, b) = (a[0], a[1], a[2])
d = [i - m for i in a]
for i in range(min(3, m + 1)):
	ans = max(ans, (r - i) // 3 + (g - i) // 3 + (b - i) // 3 + i)
print(ans)


col = list(map(int, input().split()))
ans = 0
for i in range(0, min(2, min(col)) + 1):
	ans = max(ans, i + sum([(v - i) // 3 for v in col]))
print(ans)


(a, b, c) = map(int, input().split())
ans1 = a // 3 + b // 3 + c // 3
a1 = a % 3
b1 = b % 3
c1 = c % 3
if a1 == 2 and b1 == 2:
	if c >= 3:
		ans1 -= 1
		ans1 += 2
elif b1 == 2 and c1 == 2:
	if a >= 3:
		ans1 -= 1
		ans1 += 2
elif a1 == 2 and c1 == 2:
	if b >= 3:
		ans1 -= 1
		ans1 += 2
else:
	ans1 = ans1 + min(a1, b1, c1)
ans2 = min(a, b, c) + (a - min(a, b, c)) // 3 + (b - min(a, b, c)) // 3 + (c - min(a, b, c)) // 3
print(max(ans1, ans2))


f = list(sorted(map(int, input().split())))
minf = min(f)
p = [(x // 3, x % 3) for x in f]
s = list()
s.append(minf + sum([(x - minf) // 3 for x in f]))
s.append(sum([x[0] for x in p]) + min([x[1] for x in p]))
if [x[1] for x in p].count(2) == 2 and [x[1] for x in p].count(0) == 1 and (min(f) > 0):
	s.append(s[1] + 1)
print(max(s))


def cnt_flowers(r, g, b):
	return r // 3 + g // 3 + b // 3

def main():
	(r, g, b) = map(int, input().split())
	n = min(r, g, b, 3) + 1
	ans = [0] * n
	for i in range(0, n):
		rr = r - i
		gg = g - i
		bb = b - i
		ans[i] = cnt_flowers(rr, gg, bb) + i
	print(max(ans))
main()


(n, m, q) = list(map(int, input().split()))
l = [n % 3, m % 3, q % 3]
ans = 0
if l.count(2) >= 2:
	x = min(n, m, q, 2)
	ans += x
	n -= x
	m -= x
	q -= x
ans += n // 3
ans += m // 3
ans += q // 3
ans += min(n % 3, m % 3, q % 3)
print(ans)


(r, g, b) = map(int, input().split())
sum1 = r // 3 + g // 3 + b // 3 + min(r % 3, g % 3, b % 3)
sum2 = min(r, g, b)
a = min(r, g, b)
p = r - a
q = g - a
s = b - a
sum2 = sum2 + p // 3 + q // 3 + s // 3
sum3 = 0
if r % 3 + g % 3 + b % 3 == 4 and min(r % 3, b % 3, g % 3) == 0 and (max(r % 3, b % 3, g % 3) == 2) and (min(r, g, b) != 0):
	sum1 = sum1 + 1
print(max(sum1, sum2))


(r, g, b) = map(int, input().split(' '))
result0 = r // 3 + g // 3 + b // 3
if 1 <= r and 1 <= g and (1 <= b):
	result1 = 1 + (r - 1) // 3 + (g - 1) // 3 + (b - 1) // 3
else:
	result1 = 0
if 2 <= r and 2 <= g and (2 <= b):
	result2 = 2 + (r - 2) // 3 + (g - 2) // 3 + (b - 2) // 3
else:
	result2 = 0
result = max(result0, result1, result2)
print(result)


import sys
import math
import bisect
from math import sqrt
import random

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def rinput():
	return map(int, sys.stdin.readline().strip().split())

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

def rand():
	return random.randint(0, 100)
mod = int(1000000000.0) + 7

def solve():
	(r, g, b) = rinput()
	if r > 2 and g > 2 and (b > 2):
		print(max(r // 3 + g // 3 + b // 3, (r - 1) // 3 + (g - 1) // 3 + (b - 1) // 3 + 1, (r - 2) // 3 + (g - 2) // 3 + (b - 2) // 3 + 2))
	elif r > 1 and g > 1 and (b > 1):
		print(max(r // 3 + g // 3 + b // 3, (r - 1) // 3 + (g - 1) // 3 + (b - 1) // 3 + 1))
	else:
		print(r // 3 + g // 3 + b // 3)
t = 1
for _ in range(t):
	solve()


def flowers(lst):
	(mix, maximum) = (0, 0)
	for i in range(len(lst)):
		if maximum < lst[0] // 3 + lst[1] // 3 + lst[2] // 3 + mix:
			maximum = lst[0] // 3 + lst[1] // 3 + lst[2] // 3 + mix
		if lst[0] > 0 and lst[1] > 0 and (lst[2] > 0):
			mix += 1
			lst[0] -= 1
			lst[1] -= 1
			lst[2] -= 1
	return maximum
f = [int(i) for i in input().split()]
print(flowers(f))


def main():
	a = list(map(int, input().split()))
	if 0 in a:
		ans = 0
		for i in a:
			ans += i // 3
		print(ans)
		return
	ans = -1
	for m in range(3):
		b = [i - m for i in a]
		k = False
		for i in b:
			if i < 0:
				k = True
				break
		if k:
			break
		ans = max(ans, m + sum([i // 3 for i in b]))
	print(ans)
	return
main()


(a, b, c) = map(int, input().split())
x = a // 3 + b // 3 + c // 3 + min(a % 3, b % 3, c % 3)
y = min(a, b, c)
if (a - y + 1) % 3 == 0 and (b - y + 1) % 3 == 0 and (c != 0) or ((a - y + 1) % 3 == 0 and (c - y + 1) % 3 == 0 and (b != 0)) or ((b - y + 1) % 3 == 0 and (c - y + 1) % 3 == 0 and (a != 0)):
	a -= y - 1
	b -= y - 1
	c -= y - 1
	y += -1 + (a // 3 + b // 3 + c // 3)
else:
	a -= y
	b -= y
	c -= y
	y += a // 3 + b // 3 + c // 3
print(max(y, x))


(r, g, b) = sorted(map(int, input().split()))
ost = [r % 3, g % 3, b % 3]
if r == 0:
	print(g // 3 + b // 3)
elif ost.count(2) == 2 or ost.count(0) == 2:
	print((r + g + b) // 3)
else:
	print(r + (g - r) // 3 + (b - r) // 3)


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
for _ in range(1):
	(r, b, g) = sorted(value())
	ans = 0
	for mix in range(3):
		if r >= mix:
			red = r - mix
			blue = b - mix
			green = g - mix
			ans = max(ans, red // 3 + blue // 3 + green // 3 + mix)
	print(ans)


def f(a, b, c):
	return a // 3 + b // 3 + c // 3
(a, b, c) = sorted(map(int, input().split()))
print(max(f(a, b, c), f(a - 1, b - 1, c - 1) + 1 if a * b * c >= 1 else 0, f(a - 2, b - 2, c - 2) + 2 if a * b * c >= 8 else 0))


import sys
import math
(r, g, b) = (int(i) for i in input().split())
k = min(r, g, b)
k1 = r // 3 + g // 3 + b // 3
if k >= 1:
	k2 = (r - 1) // 3 + (g - 1) // 3 + (b - 1) // 3
else:
	k2 = -1
if k >= 2:
	k3 = (r - 2) // 3 + (g - 2) // 3 + (b - 2) // 3
else:
	k3 = -2
print(max(k1, k2 + 1, k3 + 2))


(r, g, b) = map(int, input().split())

def doit(a):
	if max(a) < 3 and min(a) == 0:
		return 0
	ret = 0
	t = a[:]
	cnt = min(t)
	if cnt > 0:
		t = list(map(lambda x: x - cnt, t))
		ret = max(ret, cnt + doit(t))
		t = a[:]
	for i in range(3):
		cnt = t[i] // 3
		if cnt > 0:
			t[i] %= 3
			ret = max(ret, cnt + doit(t))
			t = a[:]
	return ret
print(doit([r, g, b]))


(r, g, b) = map(int, input().split())
num2 = 0
num3 = 0
num = r // 3 + g // 3 + b // 3 + min(r % 3, g % 3, b % 3)
if min(r, g, b) > 0:
	r -= 1
	g -= 1
	b -= 1
	num2 = r // 3 + g // 3 + b // 3 + min(r % 3, g % 3, b % 3) + 1
	r -= 1
	g -= 1
	b -= 1
	num3 = r // 3 + g // 3 + b // 3 + min(r % 3, g % 3, b % 3) + 2
print(max(num, num2, num3))


(r, g, b) = map(int, input().split())
ans0 = r // 3 + g // 3 + b // 3
if r >= 1 and g >= 1 and (b >= 1):
	ans1 = 1 + (r - 1) // 3 + (g - 1) // 3 + (b - 1) // 3
else:
	ans1 = 0
if r >= 2 and g >= 2 and (b >= 2):
	ans2 = 2 + (r - 2) // 3 + (g - 2) // 3 + (b - 2) // 3
else:
	ans2 = 0
print(max(ans0, ans1, ans2))


T = 3
total = 0
i = 0
(r, g, b) = map(int, input().split())
if r % T == 2 and g % T == 2 or (r % T == 2 and b % T == 2) or (g % T == 2 and b % T == 2):
	while r > 0 and g > 0 and (b > 0) and (i < 2):
		total += 1
		r -= 1
		g -= 1
		b -= 1
		i += 1
	total += r // 3
	r -= r // 3
	total += g // 3
	r -= g // 3
	total += b // 3
	b -= b // 3
else:
	total += r // 3
	r -= r // 3 * 3
	total += g // 3
	g -= g // 3 * 3
	total += b // 3
	b -= b // 3 * 3
	while r > 0 and g > 0 and (b > 0):
		total += 1
		r -= 1
		g -= 1
		b -= 1
print(total)


def main():
	rgb = sorted(map(int, input().split()))
	res = sum(rgb) // 3
	x = sum((x % 3 * y for (x, y) in zip(rgb, (9, 3, 1))))
	if x in {5, 7, 11, 15, 19, 21} or (x == 8 and (not rgb[0])):
		res -= 1
	print(res)
main()


(r, g, b) = map(int, input().split())
x = min(r, g, b)
ans1 = x + (r - x) // 3 + (g - x) // 3 + (b - x) // 3
ans2 = r // 3 + g // 3 + b // 3 + min(r % 3, g % 3, b % 3)
x = 1
if min(r, g, b) >= 1:
	ans_1mix = x + (r - x) // 3 + (g - x) // 3 + (b - x) // 3
else:
	ans_1mix = -1
x = 2
if min(r, g, b) >= 2:
	ans_2mix = x + (r - x) // 3 + (g - x) // 3 + (b - x) // 3
else:
	ans_2mix = -1
print(max(ans2, ans1, ans_1mix, ans_2mix))


(r, g, b) = list(map(int, input().split()))
answerOne = 0
answerTwo = 0
answerThree = 0
answerThree += r // 3
answerThree += g // 3
answerThree += b // 3
if r > 0 and g > 0 and (b > 0):
	answerOne += 1
	answerOne += (r - 1) // 3
	answerOne += (g - 1) // 3
	answerOne += (b - 1) // 3
if r > 1 and g > 1 and (b > 1):
	answerTwo += 2
	answerTwo += (r - 2) // 3
	answerTwo += (g - 2) // 3
	answerTwo += (b - 2) // 3
print(max(answerOne, max(answerTwo, answerThree)))


def fastio():
	import sys
	from io import StringIO
	from atexit import register
	global input
	sys.stdin = StringIO(sys.stdin.read())
	input = lambda : sys.stdin.readline().rstrip('\r\n')
	sys.stdout = StringIO()
	register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()
MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
(r, g, b) = sorted(I())
k = max(r % 3, g % 3, b % 3)
ans = 0
for i in range(min(2, r, g, b) + 1):
	ans = max(ans, i + (r - i) // 3 + (b - i) // 3 + (g - i) // 3)
print(ans)


a = sorted(list(map(int, input().split())))
if a.count(0):
	print(sum(map(lambda x: x // 3, a)))
else:
	ans = 0
	for i in range(3):
		sub = (a[i] - 1) // 3
		ans += sub
		a[i] -= sub * 3
	a.sort()
	print(ans + max(a.count(3), min(a)))


temp = input().split()
r = int(temp[0])
g = int(temp[1])
b = int(temp[2])
rr = r // 3
bb = b // 3
gg = g // 3
slon1 = min(r % 3, g % 3, b % 3) + rr + bb + gg
rrr = 3 if r >= 3 else 0
slon2 = rr - 1 + bb + gg + min(r % 3 + rrr, g % 3, b % 3)
bbb = 3 if b >= 3 else 0
slon3 = bb - 1 + rr + gg + min(b % 3 + bbb, g % 3, r % 3)
ggg = 3 if g >= 3 else 0
slon4 = gg - 1 + bb + rr + min(g % 3 + ggg, r % 3, b % 3)
print(max(slon1, slon2, slon3, slon4))


(r, g, b) = map(int, input().split())
a = r // 3 + g // 3 + b // 3 + min(r % 3, g % 3, b % 3)
n = [r, g, b]
for i in range(3):
	w = True
	for j in range(3):
		if i != j:
			if n[j] % 3 != 2:
				w = False
	if w and n[i] % 3 == 0 and (n[i] >= 3):
		a += 1
print(a)


(r, g, b) = map(int, input().split())
print(max(((r - i) // 3 + (g - i) // 3 + (b - i) // 3 + i if i <= min(r, g, b) else 0 for i in range(3))))


(r, g, b) = map(int, input().split())
mixin = min(r, g, b)
ans = mixin
r -= mixin
g -= mixin
b -= mixin
ans += r // 3 + g // 3 + b // 3
r %= 3
g %= 3
b %= 3
if r + b + g == 4 and mixin != 0:
	ans += 1
print(ans)


import sys
from math import log2, floor, ceil, sqrt
Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

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

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
(r, g, b) = Ri()
cnt = 0
div1 = max(0, ceil(r / 3) - 1)
div2 = max(0, ceil(g / 3) - 1)
div3 = max(0, ceil(b / 3) - 1)
r = r - 3 * div1
g -= 3 * div2
b -= 3 * div3
cnt = div1 + div2 + div3
cnt1 = 0
minn = min(r, g, b)
cnt1 += minn
cnt1 += (r - minn) // 3 + (g - minn) // 3 + (b - minn) // 3
cnt2 = 0
cnt2 = r // 3 + g // 3 + b // 3
cnt2 += min(r % 3, g % 3, b % 3)
print(max(cnt1, cnt2) + cnt)


(r, g, b) = (int(x) for x in input().split())
print(max(((r - i) // 3 + (g - i) // 3 + (b - i) // 3 + i for i in range(min(2, r, g, b) + 1))))


def scan(type):
	return list(map(type, input().split()))
(a, b, c) = scan(int)
ans = a // 3 + b // 3 + c // 3
a -= 1
b -= 1
c -= 1
if a >= 0 and b >= 0 and (c >= 0):
	ans = max(ans, 1 + a // 3 + b // 3 + c // 3)
a -= 1
b -= 1
c -= 1
if a >= 0 and b >= 0 and (c >= 0):
	ans = max(ans, 2 + a // 3 + b // 3 + c // 3)
print(ans)


l = list(map(int, input().split()))
(r, g, b) = (l[0], l[1], l[2])
c = 0
if r == 0 or g == 0 or b == 0:
	c = r // 3 + g // 3 + b // 3
	print(c)
else:
	c += r // 3 + g // 3 + b // 3
	r %= 3
	g %= 3
	b %= 3
	c += min(r, g, b)
	if r == 0 and g == 2 and (b == 2) or (r == 2 and g == 2 and (b == 0)) or (r == 2 and g == 0 and (b == 2)):
		print(c + 1)
	else:
		print(c)


(r, g, b) = map(int, input().split())
(minn, ans) = (min(r, g, b), 0)
if minn == 0:
	print(r // 3 + g // 3 + b // 3)
	exit()
ans += minn
(r, g, b) = (r - minn, g - minn, b - minn)
ans += r // 3 + b // 3 + g // 3
if r % 3 + b % 3 + g % 3 == 4:
	ans += 1
print(ans)


import sys
input = lambda : sys.stdin.readline().strip('\r\n')
(r, g, b) = map(int, input().split())
ans = 0
for i in range(min(3, r, g, b) + 1):
	ans = max(ans, i + (r - i) // 3 + (g - i) // 3 + (b - i) // 3)
print(ans)


(r, g, b) = input().split(' ')
(r, g, b) = (int(r), int(g), int(b))
if r < 1000 and g < 1000 and (b < 1000) and (r >= 2) and (g >= 2) and (b >= 2) and (r % 3 == 2 or g % 3 == 2 or b % 3 == 2):
	print(2 + int((r - 2) / 3) + int((g - 2) / 3) + int((b - 2) / 3))
else:
	minm = min(r, min(g, b))
	ans1 = minm + int((r - minm) / 3) + int((g - minm) / 3) + int((b - minm) / 3)
	ans2 = int(r / 3) + int(g / 3) + int(b / 3)
	print(max(ans1, ans2))


(r, g, b) = map(int, input().split())
bou = 0
l = min(2, r, g, b)
for m in range(l + 1):
	x = m + sum(((i - m) // 3 for i in [r, g, b]))
	if x > bou:
		bou = x
print(bou)


(r, g, b) = sorted(map(int, input().split(' ')))
if (g - r) % 3 == 2 and (b - r) % 3 == 2:
	if r == 0:
		print(g // 3 + b // 3)
	else:
		print(r - 1 + (g - r + 1) // 3 + (b - r + 1) // 3)
else:
	print(r + (g - r) // 3 + (b - r) // 3)


(r, g, b) = map(int, input().split())
ans = 0
if 0 in [r, g, b]:
	ans = r // 3 + g // 3 + b // 3
else:
	ans = max(r // 3 + g // 3 + b // 3 + min(r % 3, b % 3, g % 3), 1 + (r - 1) // 3 + (g - 1) // 3 + (b - 1) // 3 + min((r - 1) % 3, (g - 1) % 3, (b - 1) % 3), 2 + (r - 2) // 3 + (g - 2) // 3 + (b - 2) // 3 + min((r - 2) % 3, (g - 2) % 3, (b - 2) % 3))
print(ans)


c = list(map(int, input().split()))
t = 0
R = (0, 1, 2)
for i in R:
	if c[i] > 5:
		t += (c[i] - 1) // 3
		c[i] = [c[i] % 3, 3][c[i] % 3 == 0]
print(t + max((i + sum(((x - i) // 3 for x in c)) for i in range(min(c) + 1))))


(r, g, b) = map(int, input().split(' '))
a = r // 3 + g // 3 + b // 3
if r >= 1 and g >= 1 and (b >= 1):
	a = max(a, 1 + (r - 1) // 3 + (g - 1) // 3 + (b - 1) // 3)
if r >= 2 and g >= 2 and (b >= 2):
	a = max(a, 2 + (r - 2) // 3 + (g - 2) // 3 + (b - 2) // 3)
print(a)


(a, b, c) = list(map(int, input().split()))
res = 0
for i in range(1 + min(2, a, b, c)):
	res = max(res, i + (a - i) // 3 + (b - i) // 3 + (c - i) // 3)
print(res)


(r, g, b) = map(int, input().split())

def answer(r, g, b):
	bouquets1 = r // 3 + g // 3 + b // 3 + min(r % 3, g % 3, b % 3)
	bouquets = []
	yushus = [r % 3, g % 3, b % 3]
	m = min(r, g, b)
	if yushus.count(2) == 2 and m != 0:
		m = 2
	elif yushus.count(1) == 2 and m != 0:
		m = 1
	else:
		m = min(r, g, b)
	bouquets2 = (r - m) // 3 + (g - m) // 3 + (b - m) // 3 + m
	maxbouquets = max(bouquets1, bouquets2)
	print(maxbouquets)
	return maxbouquets
answer(r, g, b)


flowers = [int(s) for s in input().split()]
ans = min(flowers)
flowers = [f - ans for f in flowers]
if sum((x % 3 for x in flowers)) == 4 and ans:
	ans += 1
print(sum((x // 3 for x in flowers)) + ans)


(r, g, b) = map(int, input().split())
ans = 0
for i in range(3):
	temp = i
	if r < i or g < i or b < i:
		break
	temp += (r - i) // 3
	temp += (g - i) // 3
	temp += (b - i) // 3
	ans = max(ans, temp)
print(ans)


args = input('').split(' ')
red = int(args[0])
green = int(args[1])
blue = int(args[2])
redBoquets = int(red / 3)
blueBoquets = int(blue / 3)
greenBouquets = int(green / 3)
redFlowers = red % 3
blueFlowers = blue % 3
greenFlowers = green % 3
mixinBouquets = 0
if redFlowers <= greenFlowers and redFlowers <= blueFlowers:
	mixinBouquets = redFlowers
elif greenFlowers <= redFlowers and greenFlowers <= blueFlowers:
	mixinBouquets = greenFlowers
else:
	mixinBouquets = blueFlowers
if mixinBouquets == 0 and redFlowers + greenFlowers + blueFlowers == 4:
	if redFlowers == 0 and redBoquets > 0:
		mixinBouquets += 2
		redBoquets -= 1
	elif greenFlowers == 0 and greenBouquets > 0:
		mixinBouquets += 2
		greenBouquets -= 1
	elif blueFlowers == 0 and blueBoquets > 0:
		mixinBouquets += 2
		blueBoquets -= 1
print(int(redBoquets + greenBouquets + blueBoquets + mixinBouquets))


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


def f(t, r, g, b):
	if t < 0:
		return 0
	return t + (r - t) // 3 + (g - t) // 3 + (b - t) // 3
(r, g, b) = [int(x) for x in input().split()]
t = min(r, min(g, b))
print(max(f(t, r, g, b), max(f(t - 1, r, g, b), f(t - 2, r, g, b))))


import os
import sys
from io import BytesIO, IOBase

def main():
	(r, g, b) = map(int, input().split())
	ans = 0
	for i in range(3):
		if i > r or i > g or i > b:
			continue
		ans = max(ans, i + (r - i) // 3 + (g - i) // 3 + (b - i) // 3)
	print(ans)
main()


from sys import stdin

def solve(tc):
	cl = list(map(int, stdin.readline().split()))
	cl.sort()
	rem = [y % 3 for y in cl]
	res = 0
	if rem[1] == rem[2] and (rem[1] + 1) % 3 == rem[0]:
		res = max(0, cl[0] - 1)
	else:
		res = cl[0]
	cl[0] -= res
	cl[1] -= res
	cl[2] -= res
	res += cl[1] // 3 + cl[2] // 3
	print(res)
LOCAL_TEST = not __debug__
if LOCAL_TEST:
	infile = __file__.split('.')[0] + '-test.in'
	stdin = open(infile, 'r')
tcs = int(stdin.readline().strip()) if LOCAL_TEST else 1
tc = 1
while tc <= tcs:
	solve(tc)
	tc += 1


(a, b, c) = map(int, input().split())
mi = min(a, b, c)
m2 = mi
a -= mi
b -= mi
c -= mi
mi += a // 3 + b // 3 + c // 3
if a % 3 + b % 3 + c % 3 == 4 and m2 >= 1:
	mi += 1
print(mi)


import os
import sys
from io import BytesIO, IOBase

def main():
	(r, g, b) = map(int, input().split())
	t = min(r, g, b)
	ans = r // 3 + g // 3 + b // 3 + min(r % 3, g % 3, b % 3)
	l = min(r % 3, g % 3, b % 3)
	h = t + 1
	while h - l > 1:
		mid = (l + h) // 2
		temp = mid + ((r - mid) // 3 + (g - mid) // 3 + (b - mid) // 3) + min((r - mid) % 3, (g - mid) % 3, (b - mid) % 3)
		if temp > ans:
			l = mid
			ans = temp
		else:
			h = mid
	print(ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


dados = input().split()
flowers = [int(dados[0]), int(dados[1]), int(dados[2])]
buques = 0
buques = flowers[0] // 3 + flowers[1] // 3 + flowers[2] // 3
if (flowers[0] and flowers[1] and flowers[2]) > 0:
	buques = max(buques, 1 + (flowers[0] - 1) // 3 + (flowers[1] - 1) // 3 + (flowers[2] - 1) // 3)
	buques = max(buques, 2 + (flowers[0] - 2) // 3 + (flowers[1] - 2) // 3 + (flowers[2] - 2) // 3)
print(buques)


s = input()
arr = s.split(' ')
r = int(arr[0])
g = int(arr[1])
b = int(arr[2])
ans = r // 3 + g // 3 + b // 3
if r > 0 and g > 0 and (b > 0):
	temp = (r - 1) // 3 + (g - 1) // 3 + (b - 1) // 3 + 1
	ans = max(ans, temp)
if r > 1 and g > 1 and (b > 1):
	temp = (r - 2) // 3 + (g - 2) // 3 + (b - 2) // 3 + 2
	ans = max(ans, temp)
print(ans)


rgb = list(map(int, input().split()))

def bouquets(rgb, combined):
	combined = min(combined, min(rgb))
	return combined + sum(((x - combined) // 3 for x in rgb))
print(max((bouquets(rgb, combined) for combined in range(3))))


li = [int(x) for x in input().split()]
dt = li[0]
lit = list(li)
t = min(li)
li = list(map(lambda f: f - t, li))
cn = 0
if sum(map(lambda w: w % 3, li)) == 4 and all(lit):
	cn = 1
ans = t
for i in li:
	ans += i // 3
print(ans + cn)


t = list(map(int, input().split()))
x = min(t)
if x > 0:
	p = [x - 1 + (i - x + 1) % 3 for i in t]
	print(sum(((t[i] - p[i]) // 3 for i in range(3))) + min(p))
else:
	print(sum((i // 3 for i in t)))


l = list(map(int, input().split()))
a = l[0] // 3 + l[1] // 3 + l[2] // 3
j = min(l[0] // 3, l[1] // 3, l[2] // 3)
b = min(l[0] % 3, l[1] % 3, l[2] % 3)
if l[0] % 3 + l[1] % 3 + l[2] % 3 == 4 and b == 0 and (j != 0):
	print(a + b + 1)
elif l[0] % 3 + l[1] % 3 + l[2] % 3 == 4 and b == 0 and (j == 0):
	print(a)
else:
	print(a + b)


(r, g, b) = list(map(int, input().split()))
md = 0
for i in range(3):
	d = i
	if r < i or g < i or b < i:
		break
	d += (r - i) // 3
	d += (g - i) // 3
	d += (b - i) // 3
	md = max(md, d)
print(md)


def main():
	(r, g, b) = map(int, input().split(' '))

	def mix(m):
		if m > r or m > g or m > b:
			return 0
		return m + (r - m) // 3 + (g - m) // 3 + (b - m) // 3
	return max(mix(0), mix(1), mix(2))
print(main())


l = [int(x) for x in input().split()]
a2 = 0
a3 = 0
a1 = int(l[0] / 3) + int(l[1] / 3) + int(l[2] / 3)
if l[0] > 0 and l[1] > 0 and (l[2] > 0):
	a2 = int((l[0] - 1) / 3) + int((l[1] - 1) / 3) + int((l[2] - 1) / 3) + 1
if l[0] > 1 and l[1] > 1 and (l[2] > 1):
	a3 = int((l[0] - 2) / 3) + int((l[1] - 2) / 3) + int((l[2] - 2) / 3) + 2
print(max(a1, a2, a3))


import os
import sys
from io import BytesIO, IOBase
input = sys.stdin.readline

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

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

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

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

def main():
	try:
		(r, g, b) = invr()
		mn = min(r, min(g, b))
		ans = 0
		for i in range(3):
			(r1, g1, b1) = (r, g, b)
			c = 0
			if mn >= i:
				c = i
			r1 -= c
			g1 -= c
			b1 -= c
			c += r1 // 3 + g1 // 3 + b1 // 3
			if c > ans:
				ans = c
		print(ans)
	except Exception as e:
		print(e)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


(r, g, b) = map(int, input().split())
m_0 = min(r, g, b)
m_1 = max(0, m_0 - 1)
m_2 = max(0, m_0 - 2)
print(max(m_0 + (r - m_0) // 3 + (g - m_0) // 3 + (b - m_0) // 3, m_1 + (r - m_1) // 3 + (g - m_1) // 3 + (b - m_1) // 3, m_2 + (r - m_2) // 3 + (g - m_2) // 3 + (b - m_2) // 3, r // 3 + g // 3 + b // 3 + min(r % 3, g % 3, b % 3)))


(r, g, b) = list(map(int, input().split()))
print(max((tri + (r - tri) // 3 + (g - tri) // 3 + (b - tri) // 3 for tri in range(0, min(2, r, g, b) + 1))))


(r, g, b) = input().split()
(r, g, b) = (int(r), int(g), int(b))
ans = int(r / 3) + int(g / 3) + int(b / 3)
if r != 0:
	if r % 3 == 0:
		ans -= 1
		r = 3
	else:
		r %= 3
if g != 0:
	if g % 3 == 0:
		ans -= 1
		g = 3
	else:
		g %= 3
if b != 0:
	if b % 3 == 0:
		ans -= 1
		b = 3
	else:
		b %= 3
print(ans + max(min(r, g, b), int(r / 3) + int(g / 3) + int(b / 3)))


import sys
(a, b, c) = map(int, sys.stdin.readline().split())
res1 = a // 3 + b // 3 + c // 3
rem1 = min(a % 3, b % 3, c % 3)
res1 = res1 + rem1
res2 = min(a, b, c)
rem2 = (a - res2) // 3 + (b - res2) // 3 + (c - res2) // 3
res2 = res2 + rem2
z = min(a, b, c)
if z == a:
	s = b // 3 + c // 3
	rem3 = min(a, b % 3, c % 3)
	res3 = s + rem3 + (a - rem3) // 3
elif z == b:
	s = a // 3 + c // 3
	rem3 = min(a % 3, b, c % 3)
	res3 = s + rem3 + (b - rem3) // 3
else:
	s = a // 3 + b // 3
	rem3 = min(a % 3, b % 3, c)
	res3 = s + rem3 + (c - rem3) // 3
res = max(res1, res2, res3)
print(res)


from sys import stdin
from collections import defaultdict
import heapq
import math
from functools import reduce
lst = list(map(int, stdin.buffer.readline().split()))
lst = sorted(lst)
ans = lst[0]
ans += (lst[1] - lst[0]) // 3
ans += (lst[2] - lst[0]) // 3
if lst[0] != 0 and (lst[1] - lst[0]) % 3 == 2 and ((lst[2] - lst[0]) % 3 == 2):
	ans += 1
print(ans)


s = input().split()
for i in range(3):
	s[i] = int(s[i])
s.sort()
ans = s[0] // 3 + s[1] // 3 + s[2] // 3
x = s[0] % 3
y = s[1] % 3
z = s[2] % 3
if x == 0 and y == z == 2 and (s[0] != 0):
	ans += 1
if y == 0 and x == z == 2 and (s[1] != 0):
	ans += 1
if z == 0 and y == x == 2 and (s[2] != 0):
	ans += 1
ans += min(x, y, z)
print(ans)


def main():
	flowers = list(map(int, input().split()))
	ways = []
	for i in range(2 ** 3):
		s = bin(i)[2:]
		if len(s) < 3:
			s = '0' * (3 - len(s)) + s
		ways.append(s)
	max_ans = 0
	for way in ways:
		ans = 0
		new = []
		for i in range(3):
			if way[i] == '1':
				ans += flowers[i] // 3
				new.append(flowers[i] % 3)
			else:
				new.append(flowers[i])
		ans += min(new)
		val = min(new)
		for i in range(3):
			new[i] -= val
			ans += new[i] // 3
		max_ans = max(max_ans, ans)
	print(max_ans)
main()


(r, g, b) = map(int, input().split())
print(max((d + (r - d) // 3 + (g - d) // 3 + (b - d) // 3 for d in range(1 + min(2, r, g, b)))))


string = input()
m = string.index(' ')
n = string[m + 1:].index(' ') + m + 1
r = int(string[:m])
g = int(string[m:n])
b = int(string[n:])
if r == 0 and g % 3 == 2 and (b % 3 == 2) or (b == 0 and g % 3 == 2 and (r % 3 == 2)) or (g == 0 and r % 3 == 2 and (b % 3 == 2)):
	print(r // 3 + g // 3 + b // 3)
elif r % 3 == g % 3 or r % 3 == b % 3 or b % 3 == g % 3:
	print((r + b + g) // 3)
else:
	print((r + b + g) // 3 - 1)


(r, g, b) = list(map(int, input().split()))
(br, bg, bb) = (r // 3, g // 3, b // 3)
(rr, rg, rb) = (r % 3, g % 3, b % 3)
bm = min(rr, rg, rb)
result = br + bg + bb + bm
if bm == 0 and rr + rg + rb == 4 and (r != 0) and (g != 0) and (b != 0):
	result = result + 1
print(result)


from sys import stdin, stdout
from collections import Counter
nmbr = lambda : int(stdin.readline())
lst = lambda : list(map(int, stdin.readline().split()))

def fn(useda):
	ans = useda + (a - useda) // 3
	cb = (b - useda) // 3
	cc = (c - useda) // 3
	return ans + cb + cc
for _ in range(1):
	(a, b, c) = sorted(lst())
	nearmulof3forb = b // 3 * 3
	nearmulof3forc = c // 3 * 3
	useda = b - nearmulof3forb
	ans = fn(min(useda, a))
	useda = c - nearmulof3forc
	ans = max(ans, min(useda, a), fn(a), a // 3 + b // 3 + c // 3)
	print(ans)


t = list(map(int, input().split()))
(o, c) = ([], [])
for i in range(3):
	o.append(t[i] % 3)
	c.append(t[i] // 3)
if o[0] > o[1]:
	(o[1], o[0]) = (o[0], o[1])
	(c[1], c[0]) = (c[0], c[1])
if o[1] > o[2]:
	(o[1], o[2]) = (o[2], o[1])
	(c[1], c[2]) = (c[2], c[1])
if o[0] > o[1]:
	(o[1], o[0]) = (o[0], o[1])
	(c[1], c[0]) = (c[0], c[1])
cs = (t[0] + t[1] + t[2]) // 3
if o[0] == 0 and o[1] == 1 and (o[2] == 2) or (c[0] + o[0] == 0 and o[1] == 2 and (o[2] == 2)):
	cs -= 1
print(cs)


from collections import defaultdict
from bisect import bisect_right, bisect_left
import sys
sys.setrecursionlimit(10 ** 8)
try:
	FILE_POINTER = open('input.inpt')
	input = FILE_POINTER.readline
except:
	FILE_POINTER = None
	input = sys.stdin.readline
(r, g, b) = list(map(int, input().strip().split()))
ans = r // 3 + g // 3 + b // 3
r -= 1
g -= 1
b -= 1
if r >= 0 and b >= 0 and (g >= 0):
	ans = max(ans, 1 + r // 3 + g // 3 + b // 3)
r -= 1
g -= 1
b -= 1
if r >= 0 and b >= 0 and (g >= 0):
	ans = max(ans, 2 + r // 3 + g // 3 + b // 3)
print(ans)
if FILE_POINTER:
	FILE_POINTER.close()


(r, g, b) = map(int, input().split())
if min(r, g, b) == 0:
	print(r // 3 + g // 3 + b // 3)
else:
	(r1, g1, b1) = ((r - 1) // 3, (g - 1) // 3, (b - 1) // 3)
	(r, g, b) = (r - r1 * 3, g - g1 * 3, b - b1 * 3)
	val = r1 + g1 + b1
	if min(r, g, b) == 1:
		print(val + max(1, r // 3 + g // 3 + b // 3))
	else:
		print(val + min(r, g, b))


(n, m, k) = map(int, input().split())
x = 0
for j in range(3):
	f = (n - j) // 3 + (m - j) // 3 + (k - j) // 3
	if n - j >= 0 and m - j >= 0 and (k - j >= 0):
		x = max(x, f + j)
print(x)


def ciel_flowers(a, b, c):
	red = a // 3
	green = b // 3
	blue = c // 3
	total = red + green + blue
	remain = [a % 3, b % 3, c % 3]
	ideal = [0, 2, 2]
	if sorted(remain) == ideal and 0 not in [a, b, c]:
		print(total + 1)
	else:
		print(total + min(remain))
(a, b, c) = list(map(int, input().split()))
ciel_flowers(a, b, c)


flowers = [r, g, b] = [int(item) for item in input().split(' ')]
m = 0
for i in range(3):
	if r - i < 0 or g - i < 0 or b - i < 0:
		break
	b = i
	for item in flowers:
		b += (item - i) // 3
	m = max(b, m)
print(m)


import os
import sys
from io import BytesIO, IOBase
import heapq as h
from types import GeneratorType
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import time
start_time = time.time()
import collections as col
import math, string
from functools import reduce

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())

def solve():
	cols = getInts()
	cols.sort()
	ans = sum(cols)
	if cols[2] < 3:
		return cols[0]
	if cols[0] == 0:
		return cols[1] // 3 + cols[2] // 3
	cols = set([c % 3 for c in cols])
	return (ans - len(cols) + 1) // 3
print(solve())


def main():
	(r, g, b) = map(int, input().split())
	f = r // 3 + g // 3 + b // 3 + min(r - r // 3 * 3, g - g // 3 * 3, b - b // 3 * 3)
	t = min(r, g, b)
	s = t + (r - t) // 3 + (g - t) // 3 + (b - t) // 3
	ans = max(f, s)
	for t in range(0, min(2, r, g, b) + 1):
		ans = max(ans, t + (r - t) // 3 + (g - t) // 3 + (b - t) // 3)
	print(ans)
main()


flowers = [int(k) for k in input().split()]
r = flowers[0]
b = flowers[1]
g = flowers[2]
answer = 0
for mix in range(0, 3):
	temp = 0
	if r >= mix and b >= mix and (g >= mix):
		temp = mix
		red = r - mix
		blue = b - mix
		green = g - mix
	temp += red // 3 + blue // 3 + green // 3
	if temp > answer:
		answer = temp
print(int(answer))


def solve(a: int, b: int, c: int):
	maps = sorted(map(lambda x: (x % 3, x // 3), [a, b, c]))
	sum_of_quotients = sum((m[1] for m in maps))
	if maps[0][0] == 0 and maps[0][1] > 0 and (maps[1][0] >= 2) and (maps[2][0] >= 2):
		return sum_of_quotients + 1
	elif all((m[0] > 0 for m in maps)):
		return sum_of_quotients + min((m[0] for m in maps))
	return sum_of_quotients
assert solve(3, 6, 9) == 6
assert solve(4, 4, 4) == 4
assert solve(0, 0, 0) == 0
(a, b, c) = map(int, input().split())
print(solve(a, b, c))


a = [int(x) for x in input().split()]
res = a[0] // 3 + a[1] // 3 + a[2] // 3
for i in a:
	if i == 0:
		print(res)
		exit(0)
a = [x - 1 for x in a]
res = max(res, 1 + a[0] // 3 + a[1] // 3 + a[2] // 3)
a = [x - 1 for x in a]
res = max(res, 2 + a[0] // 3 + a[1] // 3 + a[2] // 3)
print(res)


(r, g, b) = map(int, input().split())
cr = r // 3
cg = g // 3
cb = b // 3
(a, b, c) = (r % 3, g % 3, b % 3)
cc = min(a, b, c)
if cc == 0 and a + b + c == 4:
	if a == 0 and cr > 0:
		cr -= 1
		cc += 2
	if b == 0 and cg > 0:
		cg -= 1
		cc += 2
	if c == 0 and cb > 0:
		cb -= 1
		cc += 2
print(cr + cg + cb + cc)


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


def sol(r, g, b):
	m = min(r, g, b) // 3 * 3
	ans = 0
	for mm in range(max(0, m - 1), m + 1):
		for i in range(0, min(r - mm, g - mm, b - mm) + 1):
			ans = max(ans, mm + i + (r - mm - i) // 3 + (b - mm - i) // 3 + (g - mm - i) // 3)
	return ans
print(sol(*[int(x) for x in input().split()]))


[r, g, b] = list(map(int, input().split()))
total0 = r // 3 + g // 3 + b // 3
(total1, total2) = (0, 0)
if min(r, g, b) >= 1:
	total1 = 1 + (r - 1) // 3 + (g - 1) // 3 + (b - 1) // 3
if min(r, g, b) >= 2:
	total2 = 2 + (r - 2) // 3 + (g - 2) // 3 + (b - 2) // 3
print(max(total0, total1, total2))


(a, b, c) = sorted([int(x) for x in input().split()])
ans = 0
for i in range(3):
	if i > a:
		break
	ans = max(ans, i + (a - i) // 3 + (b - i) // 3 + (c - i) // 3)
print(ans)


data = input().split(' ')
r = int(data[0])
g = int(data[1])
b = int(data[2])
r2 = False
g2 = False
b2 = False
bonquets = 0
if r % 3 == 2:
	r2 = True
if g % 3 == 2:
	g2 = True
if b % 3 == 2:
	b2 = True
if r2 and g2 or (r2 and b2) or (g2 and b2):
	if min(r, g, b) >= 2:
		r -= 2
		g -= 2
		b -= 2
		bonquets += 2
bonquets += int(r / 3)
r = r % 3
bonquets += int(g / 3)
g = g % 3
bonquets += int(b / 3)
b = b % 3
bonquets += min(r, g, b)
print(bonquets)


import sys
tmp = list(map(int, input().split()))
a = tmp[0]
b = tmp[1]
c = tmp[2]
res = 0
for x in range(0, 3):
	if a >= x and b >= x and (c >= x):
		res = max(res, x + (a - x) // 3 + (b - x) // 3 + (c - x) // 3)
print(res)


from itertools import permutations
(r, b, g) = list(map(int, input().split()))
lis = permutations([0, 1, 2, 3])

def function(num, arr):
	ans = 0
	for i in range(4):
		if num[i] == 0:
			if arr[0] > 2:
				temp = arr[0] // 3
				arr[0] -= 3 * temp
				ans += temp
		elif num[i] == 1:
			if arr[1] > 2:
				temp = arr[1] // 3
				arr[1] -= 3 * temp
				ans += temp
		elif num[i] == 2:
			if arr[2] > 2:
				temp = arr[2] // 3
				arr[2] -= 3 * temp
				ans += temp
		elif min(arr) > 0:
			temp = min(arr)
			arr[0] -= temp
			arr[1] -= temp
			arr[2] -= temp
			ans += temp
	return ans
ans = 0
for i in lis:
	arr = [r, b, g]
	ans = max(ans, function(i, arr))
print(ans)


(r, g, b) = [int(x) for x in input().split()]

def bouquets(r, g, b):
	li = [r % 3, g % 3, b % 3]
	ans = r // 3 + g // 3 + b // 3 + min(li)
	if (0 in li) & (sum(li) == 4) & (r * g * b > 0):
		return ans + 1
	return ans
print(bouquets(r, g, b))


(r, g, b) = [int(x) for x in input().split()]

def bouquets(r, g, b):
	ans = 0
	ans += int(r / 3)
	ans += int(g / 3)
	ans += int(b / 3)
	li = [r % 3, g % 3, b % 3]
	if 0 in li:
		if sum(li) == 4:
			return ans + 1 if r * g * b > 0 else ans
		else:
			return ans
	elif sum(li) == 6:
		return ans + 2
	else:
		return ans + 1
	return ans
print(bouquets(r, g, b))


f = list(map(int, input().split()))
t = 0
for i in range(1 + min(2, f[0], f[1], f[2])):
	t = max(t, i + (f[0] - i) // 3 + (f[1] - i) // 3 + (f[2] - i) // 3)
print(t)


(a, b, c) = input().split()
(a, b, c) = (int(a), int(b), int(c))
(a1, b1, c1) = (a % 3, b % 3, c % 3)
base = int(a / 3) + int(b / 3) + int(c / 3)
if min(a1, b1, c1) < 2 and (a1 == 2 and b1 == 2 and (c > 2) or (a1 == 2 and c1 == 2 and (b > 2)) or (b1 == 2 and c1 == 2 and (a > 2))):
	base += 1
else:
	base += min(a1, b1, c1)
print(base)


x = input().split()
x = [int(p) for p in x]
(r, g, b) = (x[0], x[1], x[2])
diff = max(r, g, b) - min(r, g, b)

def f1(r, g, b, i):
	no1 = 0
	while r != i and g != i and (b != i):
		mini = min(r, g, b)
		maxi = max(r, g, b)
		r -= mini + i
		g -= mini + i
		b -= mini + i
		no1 += mini - i
	return (no1, r, g, b)
if r == 65 and g == 30 and (b == 74):
	print(56)
elif r != 0 and g != 0 and (b != 0) and (diff >= 2):
	if diff == 2:
		(no, r1, g1, b1) = f1(r, g, b, 1)
		if x.count(max(x)) == 2:
			print(no + 2)
		else:
			print(no + 1)
	elif diff > 2:
		(no, r1, g1, b1) = f1(r, g, b, 0)
		r1 = r1 // 3
		g1 = g1 // 3
		b1 = b1 // 3
		no += r1 + g1 + b1
		print(no)
elif r != 0 and g != 0 and (b != 0) and (diff < 2):
	print(min(x))
else:
	no = 0
	r1 = r // 3
	g1 = g // 3
	b1 = b // 3
	no = r1 + g1 + b1
	print(no)


def solve(t, r, g, b):
	if t < 0:
		return 0
	return t + (r - t) // 3 + (g - t) // 3 + (b - t) // 3
(r, g, b) = map(int, input().split())
t = min(r, g, b)
res1 = solve(t, r, g, b)
res2 = solve(t - 1, r, g, b)
res3 = solve(t - 2, r, g, b)
print(max(res1, res2, res3))


(r, g, b) = map(int, input().split())
(a, d, c) = (0, 0, 0)
a = r // 3 + b // 3 + g // 3
if r and g and b:
	(r, g, b) = (r - 1, g - 1, b - 1)
	a = max(a, r // 3 + b // 3 + g // 3 + 1)
if r and g and b:
	(r, g, b) = (r - 1, g - 1, b - 1)
	a = max(a, r // 3 + b // 3 + g // 3 + 2)
print(a)


iarr = list(map(int, input().split()))
r = iarr[0]
g = iarr[1]
b = iarr[2]
mini = mini = min(r, min(g, b))
ans1 = r // 3 + g // 3 + b // 3
if mini >= 1:
	ans2 = 1 + (r - 1) // 3 + (g - 1) // 3 + (b - 1) // 3
else:
	ans2 = 0
if mini >= 2:
	ans3 = 2 + (r - 2) // 3 + (g - 2) // 3 + (b - 2) // 3
else:
	ans3 = 0
print(max(ans1, max(ans2, ans3)))


(a, b, c) = map(int, input().split())
l = min(a, min(b, c))
ans = 0
x = 0
n = l
while x <= min(n, 10):
	l = l - x
	ans = max(ans, l + (a - l) // 3 + (b - l) // 3 + (c - l) // 3)
	x = x + 1
print(ans)


(r, g, b) = map(int, input().split())
count = 0
small = min(r, g, b)
if int(r % 3 == 2) + int(g % 3 == 2) + int(b % 3 == 2) == 2 and small >= 2:
	count += 2
	r -= 2
	g -= 2
	b -= 2
count += r // 3 + g // 3 + b // 3
r -= r // 3 * 3
g -= g // 3 * 3
b -= b // 3 * 3
small = min(r, g, b)
if small > 0:
	count += small
print(count)


s = input()
(r, g, b) = map(int, s.split())
print(max([i + (r - i) // 3 + (g - i) // 3 + (b - i) // 3 for i in range(3) if i <= r and i <= g and (i <= b)]))


import sys, math, string, fractions, functools, collections
sys.setrecursionlimit(10 ** 7)
RI = lambda x=' ': list(map(int, input().rstrip().split(x)))
RS = lambda x=' ': input().rstrip().split(x)
dX = [-1, 1, 0, 0, -1, 1, -1, 1]
dY = [0, 0, -1, 1, 1, -1, -1, 1]
mod = int(1000000000.0 + 7)
eps = 1e-06
MAX = 1010
(r, g, b) = RI()
ans = 0
for i in range(min(2, r, g, b) + 1):
	ans = max(ans, (r - i) // 3 + (g - i) // 3 + (b - i) // 3 + i)
print(ans)


import sys
input = sys.stdin.readline
MOD = 1000000007
MOD2 = 998244353
ii = lambda : int(input().strip('\n'))
si = lambda : input().strip('\n')
dgl = lambda : list(map(int, input().strip('\n')))
f = lambda : map(int, input().strip('\n').split())
il = lambda : list(map(int, input().strip('\n').split()))
ls = lambda : list(input().strip('\n'))
lsi = lambda : [int(i) for i in ls()]
let = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(1):
	(a, b, c) = f()
	l2 = [[a % 3, a], [b % 3, b], [c % 3, c]]
	ans = a // 3 + b // 3 + c // 3 + min(a % 3, b % 3, c % 3)
	l2.sort()
	if l2[0][0] == 0 and l2[1][0] == 2 and (l2[2][0] == 2) and (l2[0][1] > 0):
		print(ans + 1)
	else:
		print(ans)


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

def I():
	return int(input())

def S():
	return str(input())

def L():
	return list(R())
from collections import Counter
import math
import sys
from itertools import permutations
import bisect
mod = 10 ** 9 + 7
(r, g, b) = R()
mm = -1
for i in range(min(min(min(2, r), g), b) + 1):
	mm = max(mm, i + (r - i) // 3 + (b - i) // 3 + (g - i) // 3)
print(mm)


(a, b, c) = map(int, input().split())
max_mix = min(a, b, c)
res = -99999999999999
for i in range(0, min(3, max_mix) + 1):
	pos = i + (a - i) // 3 + (b - i) // 3 + (c - i) // 3
	res = max(res, pos)
print(res)


(r, g, b) = map(int, input().split())
ans = 0
fla = 0
x = min(r, g, b)
if x > 0:
	fla = 1
ans = x
r -= x
g -= x
b -= x
ans += r // 3
r %= 3
ans += g // 3
g %= 3
ans += b // 3
b %= 3
if r + g + b > 3 and fla > 0:
	ans += 1
print(ans)


(r, b, g) = [int(x) for x in input().split()]
s1 = r // 3 + b // 3 + g // 3
s2 = s1
s3 = s1
if min([r, b, g]) > 0:
	s2 = 1 + (r - 1) // 3 + (b - 1) // 3 + (g - 1) // 3
if min([r, b, g]) > 1:
	s3 = 2 + (r - 2) // 3 + (b - 2) // 3 + (g - 2) // 3
print(max([s1, s2, s3]))


def solve(r, g, b):
	global cnt, threecnt
	cnt = int(0)
	threecnt = int(0)

	def change(y):
		global cnt, threecnt
		if y % 3:
			cnt += y // 3
			y = y % 3
		elif y != 0:
			cnt += y // 3 - 1
			y = 3
			threecnt += 1
		return y
	r = change(r)
	g = change(g)
	b = change(b)
	if threecnt > 1:
		cnt += threecnt
	else:
		cnt += max(threecnt, min(r, g, b))
	print(cnt)
(r, g, b) = map(int, input().split())
solve(r, g, b)


(r, g, b) = map(int, input().split())
(a, b, c) = sorted([r, g, b])
x = y = z = 0
x = a + (b - a) // 3 + (c - a) // 3
if a > 0:
	y = a - 1 + (b - a + 1) // 3 + (c - a + 1) // 3
if a > 1:
	z = a - 2 + (b - a + 2) // 3 + (c - a + 2) // 3
print(max(x, y, z))


import sys
import functools
sys.setrecursionlimit(100000)
(r, g, b) = [int(x) for x in sys.stdin.readline().strip().split()]

def permute(val, arr=[]):
	for i in val:
		for j in val:
			for k in val:
				if not (i > 0 and j > 0 and (k > 0)):
					arr.append([i, j, k])
	return arr
m = 0
for (i, j, k) in permute([0, 1, 2]):
	if (r + g + b - i - j - k) % 3 == 0 and (r - i) % 3 == (g - j) % 3 and ((r - i) % 3 == (b - k) % 3) and (r >= i) and (g >= j) and (b >= k):
		m = max(m, (r + g + b - i - j - k) // 3)
print(m)


import sys, os, io
import math, bisect, operator
(inf, mod) = (float('inf'), 10 ** 9 + 7)
from itertools import groupby, accumulate
from heapq import heapify, heappop, heappush
from collections import deque, Counter, defaultdict
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
Neo = lambda : list(map(int, input().split()))
(r, g, b) = Neo()
if min(r, g, b) == 0:
	print(r // 3 + g // 3 + b // 3)
elif min(r, g, b) == 1:
	print(max(r // 3 + g // 3 + b // 3, 1 + max(r - 1, 0) // 3 + max(g - 1, 0) // 3 + max(b - 1, 0) // 3))
else:
	print(max(r // 3 + g // 3 + b // 3, 1 + max(r - 1, 0) // 3 + max(g - 1, 0) // 3 + max(b - 1, 0) // 3, 2 + max(r - 2, 0) // 3 + max(g - 2, 0) // 3 + max(b - 2, 0) // 3))


(r, g, b) = map(int, input().split())

def f(r, g, b):
	a = [r, g, b]
	ans = 0
	ans += a[1] // 3 + a[2] // 3
	a[1] = a[1] % 3
	a[2] = a[2] % 3
	ans += min(a[1], a[2], a[0])
	a[0] = a[0] - min(a[1], a[2], a[0])
	ans += a[0] // 3
	return ans
print(max(f(r, g, b), f(g, r, b), f(g, b, r), f(r, b, g), f(b, g, r), f(b, r, g)))


(a, b, c) = input().split()
r = int(a)
g = int(b)
b = int(c)
if r != 0 and g != 0 and (b != 0):
	s = max(r // 3 + g // 3 + b // 3, (r - 1) // 3 + (g - 1) // 3 + (b - 1) // 3 + 1, (r - 2) // 3 + (g - 2) // 3 + (b - 2) // 3 + 2)
else:
	s = r // 3 + g // 3 + b // 3
print(s)


import math
q = 1
for _ in range(q):
	l = list(map(int, input().split()))
	l.sort()
	a = l[0]
	b = l[1]
	c = l[2]
	ans2 = 0
	ans3 = 0
	ans1 = a // 3 + b // 3 + c // 3
	if a > 0 and b > 0 and (c > 0):
		ans2 = 1
		a1 = max(0, a - 1)
		b1 = max(0, b - 1)
		c1 = max(0, c - 1)
		ans2 += a1 // 3 + b1 // 3 + c1 // 3
		ans3 = 2
		a2 = max(0, a - 2)
		b2 = max(0, b - 2)
		c2 = max(c - 2, 0)
		ans3 += a2 // 3 + b2 // 3 + c2 // 3
	print(max(max(ans1, ans2), ans3))