You have r red, g green and b blue balloons. To decorate a single table for the banquet you need exactly three balloons. Three balloons attached to some table shouldn't have the same color. What maximum number t of tables can be decorated if we know number of balloons of each color?

Your task is to write a program that for given values r, g and b will find the maximum number t of tables, that can be decorated in the required manner.


-----Input-----

The single line contains three integers r, g and b (0 ≤ r, g, b ≤ 2·10^9) — the number of red, green and blue baloons respectively. The numbers are separated by exactly one space.


-----Output-----

Print a single integer t — the maximum number of tables that can be decorated in the required manner.


-----Examples-----
Input
5 4 3

Output
4

Input
1 1 1

Output
1

Input
2 3 3

Output
2



-----Note-----

In the first sample you can decorate the tables with the following balloon sets: "rgg", "gbb", "brr", "rrg", where "r", "g" and "b" represent the red, green and blue balls, respectively.

Difficulty: MEDIUM_HARD

Solutions:
(r, g, b) = map(int, input().split())
(r, g, b) = sorted([r, g, b])
s1 = (r + g + b) // 3
s2 = r + g
print(min(s1, s2))


l = [int(s) for s in input().split(' ')]
l.sort()
res = min(l[0] + l[1], (l[0] + l[1] + l[2]) // 3)
print(res)


import sys
f = sys.stdin
a = [int(u) for u in f.readline().strip().split()]
a.sort(reverse=True)
t = a[2]
dt = min(a[0] - a[1], 2 * t) // 2
a[2] -= dt
a[0] -= 2 * dt
a[0] -= a[2]
a[1] -= a[2]
t += min((a[0] + a[1]) // 3, a[1])
print(t)


v = list((int(x) for x in input().split()))
s = sum(v)
print(min(s // 3, s - max(v)))


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


(r, g, b) = map(int, input().split())
s = sorted([r, g, b])
print(min(sum(s) // 3, sum(s[:2])))


alle = input()
alle = list(map(int, alle.split()))
alle.sort(reverse=True)
if alle[0] >= 2 * (alle[1] + alle[2]):
	print(alle[1] + alle[2])
else:
	print((alle[0] + alle[1] + alle[2]) // 3)


(r, g, b) = [int(x) for x in input().split()]
a = min(r + g, g + b, b + r, (r + g + b) // 3)
print(a)


col = input().split()
for i in range(3):
	col[i] = int(col[i])
col.sort()
if col[0] == 0:
	if col[2] >= 2 * col[1]:
		print(col[1])
	else:
		print(int((col[2] + col[1]) / 3))
elif 2 * (col[1] + col[0]) < col[2]:
	print(col[1] + col[0])
else:
	print(col[0] + int((col[0] + col[1] + col[2] - 3 * col[0]) / 3))


import math
import sys
input = sys.stdin.readline

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

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

def insr():
	s = input().strip()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())
l = inlt()
l.sort()
(a, b, c) = l
print(min(a + b, b + c, c + a, (a + b + c) // 3))


import math
[r, g, b] = map(int, input().split(' '))
print(min((r + g + b) // 3, r + g, g + b, r + b))


c = list(map(int, input().split()))
c.sort()
print(c[0] + c[1] if c[0] + c[1] <= c[2] // 2 else sum(c) // 3)


import math
(r, g, b) = map(int, input().split(' '))
li = [r, g, b]
li.sort()
if li[2] > 2 * (sum(li) - li[2]):
	print(sum(li) - li[2])
else:
	print(sum(li) // 3)


l = list(map(int, input().split()))
l.sort()
su = sum(l)
print(min(su // 3, l[0] + l[1]))


arr = list(map(int, input().split()))
sm = 0
arr.sort()
if arr[2] // 2 <= arr[0] + arr[1]:
	print(sum(arr) // 3)
else:
	print(arr[0] + arr[1])


x = list(map(int, input().split()))
x.sort()
ans = 0
if x[2] <= x[0] + x[1]:
	print(sum(x) // 3)
else:
	print(min(sum(x) // 3, x[0] + x[1]))


(r, g, b) = map(int, input().split())
maxi = (r + g + b) // 3
print(min(maxi, r + g, r + b, g + b))


(r, g, b) = map(int, input().split())
res = (r + g + b) // 3
mx = max(max(r, g), b)
if mx >= 2 * res:
	res = min(r + g + b - mx, res)
print(res)


rgb = list(map(int, input().split()))
rgb.sort()
a = min(rgb[0] + rgb[1], sum(rgb) // 3)
print(a)


(r, g, b) = input().split()
(r, g, b) = reversed(sorted([int(r), int(g), int(b)]))
print(min((r + g + b) // 3, g + b))


inp = [int(x) for x in input().split()]
print(min(sum(inp) // 3, sum(inp) - max(inp)))


(in1, in2, in3) = map(int, input().split())
t = min(in1 + in2, in1 + in3, in3 + in2, (in1 + in3 + in2) // 3)
print(t)


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


import math

def init():
	balloons = list(map(lambda x: int(x), input().split(' ')))
	balloons.sort()
	counter = 0
	if balloons[0] + balloons[1] <= math.floor(balloons[2] / 2):
		counter = balloons[0] + balloons[1]
	elif balloons[0] == balloons[1] and balloons[1] == balloons[2]:
		counter = balloons[0]
	else:
		max_b = math.floor((balloons[0] + balloons[1] + balloons[2]) / 3)
		counter = int(min(balloons[0] + balloons[1], max_b))
	print(counter)
init()


def main():
	a = read()
	a.sort()
	res = 0
	if a[1] - a[0] <= a[2] - a[1]:
		res += a[1] - a[0]
		a[1] -= res
		a[2] -= 2 * res
		if 4 * a[0] <= a[2]:
			print(res + 2 * a[0])
			return
		else:
			n = (a[2] - a[0]) // 3
			res += 2 * n
			a[0] -= n
			a[1] -= n
			a[2] -= 4 * n
			if 0 < a[0] == a[2] - 2:
				res += 1
				a[0] -= 1
				a[2] -= 2
			print(res + a[0])
			return
	else:
		res += a[2] - a[1]
		a[1] -= res
		a[2] -= 2 * res
		n = (a[1] - a[0]) // 3
		res += 2 * n
		a[1] -= 3 * n
		a[2] -= 3 * n
		if a[1] == a[0] + 2:
			res += 1
			a[1] -= 2
			a[2] -= 1
		print(res + a[0])
		return

def read(mode=2):
	inputs = input().strip()
	if mode == 0:
		return inputs
	if mode == 1:
		return inputs.split()
	if mode == 2:
		return list(map(int, inputs.split()))

def write(s='\n'):
	if s is None:
		s = ''
	if isinstance(s, list):
		s = ' '.join(map(str, s))
	s = str(s)
	print(s, end='')
import itertools
write(main())


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
(r, g, b) = mi()
if r > 2 * (g + b):
	print(g + b)
elif g > 2 * (r + b):
	print(r + b)
elif b > 2 * (r + g):
	print(r + g)
else:
	print((r + g + b) // 3)


def sort3(a, b, c):
	if a > b:
		(a, b) = (b, a)
	if b > c:
		(b, c) = (c, b)
	if a > b:
		(a, b) = (b, a)
	return (a, b, c)

def main():
	(r, g, b) = tuple(map(int, input().split()))
	(r, g, b) = sort3(r, g, b)
	if b > 2 * (r + g):
		print(r + g)
	else:
		print((r + g + b) // 3)
main()


(r, g, b) = map(int, input().split())
(r, g, b) = sorted([r, g, b], reverse=True)
print(min((r + g + b) // 3, g + b))


from math import floor
rgb = list(map(int, input().split()))
print(floor(min(sum(rgb) / 3, sum(rgb) - max(rgb))))


a = [int(s) for s in input().split(' ')]
a.sort()
if a[2] >= 2 * (a[0] + a[1]):
	print(a[0] + a[1])
else:
	print(sum(a) // 3)


p = [int(x) for x in input().split()]
p = sorted(p)
t = int(sum(p) / 3)
print(min(p[1] + p[0], t))


3
c = list(map(int, input().split()))
print(min(sum(c) // 3, sum(c) - max(c)))


(r, g, b) = map(int, input().split())
x = int((r + b + g) / 3)
print(min(x, r + g, g + b, b + r))


(a, b, c) = map(int, input().split())
print(min(a + c, a + b, b + c, (a + b + c) // 3))


color = list(map(int, input().split()))
print(min(sum(color) // 3, sum(color) - max(color)))


a = sorted(list(map(int, input().split())))
a[2] = min(a[2], (a[0] + a[1]) * 2)
print((a[0] + a[1] + a[2]) // 3)


r_g_b_ballons = list(map(int, input().split()))
r_g_b_ballons.sort()
print(min(sum(r_g_b_ballons) // 3, r_g_b_ballons[0] + r_g_b_ballons[1]))


a = sorted(list(map(int, input().split())))
ans = 0
if max(a) >= 2 * (sum(a) - max(a)):
	ans = sum(a) - max(a)
else:
	ans = sum(a) // 3
print(ans)


(a, b, c) = sorted([int(i) for i in input().split()])
print(min(int((a + b + c) / 3), a + b))


colors = list(map(int, input().split()))
colors.sort()
(x, y, z) = (colors[0], colors[1], colors[2])
if z >= 2 * (x + y + z - z):
	print(x + y)
else:
	print((x + y + z) // 3)


sl = list(map(int, input().split()))
sl.sort()
if sl[2] > 2 * (sl[0] + sl[1]):
	sl[2] = 2 * (sl[0] + sl[1])
print((sl[2] + sl[0] + sl[1]) // 3)


a = list(map(int, input().split()))
a.sort()
d = a[1] - a[0]
e = a[2] - a[1]
t = 0
if d <= e:
	t = d
	h = e - d
	if h <= 3 * a[0]:
		if h % 3 == 0:
			x = h // 3
			y = x
		elif h % 3 == 1:
			x = (h - 1) // 3
			y = x - 1
		elif h % 3 == 2:
			x = (h + 1) // 3
			y = x + 1
		t += 2 * x + (3 * a[0] - 2 * x - y) // 3
	else:
		t += 2 * a[0]
else:
	t = e + (3 * a[0] + 2 * (d - e)) // 3
print(t)


l = sorted(list(map(int, input().split())))
print(min(l[0] + l[1], sum(l) // 3))


rgb_list = input().split()
rgb_list[0] = int(rgb_list[0])
rgb_list[1] = int(rgb_list[1])
rgb_list[2] = int(rgb_list[2])
rgb_list.sort()
if rgb_list[2] >= 2 * (rgb_list[0] + rgb_list[1]):
	print(rgb_list[0] + rgb_list[1])
else:
	print((rgb_list[0] + rgb_list[1] + rgb_list[2]) // 3)


a = list(map(int, input().split()))
a.sort()
isk = sum(a) // 3 * 3
if a[2] > (a[0] + a[1]) * 2:
	isk -= a[2] - (a[0] + a[1]) * 2
print(max((isk + 2) // 3, 0))


from math import ceil

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 int(min(sum(l) / 3, l[0] + l[1]))
t = 1
while t:
	t = t - 1
	l = list(map(int, input().strip().split()))[:3]
	print(count_tables(l))


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

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()]
(r, a, b) = sorted(value())
if b >= 2 * (r + a):
	print(a + r)
else:
	print((r + a + b) // 3)


bls = sorted(list(map(int, input().split())), reverse=True)
amt = 0
if bls[1] != bls[2]:
	amt = min(bls[0] - bls[1], bls[1] - bls[2])
	bls[0] -= amt * 2
	bls[1] -= amt
if bls[0] == bls[1] and bls[1] > bls[2]:
	amt += (bls[0] - bls[2]) // 3 * 2
	bls[0] -= (bls[0] - bls[2]) // 3 * 3
	bls[1] = bls[0]
	if bls[0] - bls[2] == 2:
		amt += 1
		bls[0] -= 1
		bls[1] -= 2
elif bls[0] > bls[1]:
	x = min(bls[1], (bls[0] - bls[1]) // 3)
	amt += x * 2
	bls[0] -= x * 4
	bls[1] -= x
	bls[2] -= x
print(amt + bls[2])


a = list(map(int, input().split()))
a.sort(reverse=True)
if a[0] > 2 * (a[1] + a[2]):
	print(a[1] + a[2])
else:
	print(sum(a) // 3)


from math import ceil

def color(r, g, b):
	if min(r, g, b) == 0:
		lst = [r, g, b]
		ans = sum(lst) // 3
		lst.remove(0)
		return min(ans, min(lst))
	return min((r + g + b) // 3, r + b + g - max(r, g, b))
(a, b, c) = map(int, input().strip().split())
print(color(a, b, c))


(r, g, b) = (int(x) for x in input().split())
if max(r, g, b) >= 2 * (r + g + b - max(r, g, b)):
	print(r + g + b - max(r, g, b))
else:
	print((r + g + b) // 3)


l = list(input().split(' '))
k = []
k.append(int(l[0]))
k.append(int(l[1]))
k.append(int(l[2]))
k.sort()
if k[2] > 2 * (k[0] + k[1]):
	print(k[0] + k[1])
else:
	print((k[0] + k[1] + k[2]) // 3)


import os, sys
from io import BytesIO, IOBase

def main():
	(r, g, b) = map(int, input().split())
	if max(r, g, b) >= (r + g + b - max(r, g, b)) * 2:
		print(r + g + b - max(r, g, b))
	else:
		print((r + g + b) // 3)
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()


balloons = list(map(int, input().split(' ')))
balloons.sort()
(a, b, c) = list(map(int, balloons))
if a + b <= int(c / 2):
	print(a + b)
else:
	print((a + b + c) // 3)


import math
a = list(map(int, input().split()))
a.sort(reverse=True)
(a, b, c) = a
res = 0
x = a - b
if b - x >= c:
	a = a - 2 * x
	b = b - x
	res = x + (a + b + c) // 3
else:
	x = b - c
	a = a - 2 * x
	b = c
	res = x
	x = (a - b) * 2 // 3
	if b - x / 2 >= 0:
		res += x + (b - math.ceil(x / 2))
	else:
		res += 2 * b
print(res)


line = input().split()
red = int(line[0])
green = int(line[1])
blue = int(line[2])
baloons = [red, green, blue]
baloons.sort(reverse=True)
tables = 0
delta = min(baloons[0] - baloons[1], baloons[1] - baloons[2])
baloons[0] -= 2 * delta
baloons[1] -= delta
tables += delta
if baloons[0] == baloons[1] and baloons[1] == baloons[2]:
	tables += baloons[0]
	print(tables)
elif baloons[0] == baloons[1]:
	delta = baloons[0] - baloons[2]
	tables += 2 * (delta // 3)
	if delta % 3 == 2:
		tables += 1
	tables += baloons[2]
	print(tables)
else:
	delta = min((baloons[0] - baloons[2]) // 3, baloons[2])
	tables += 2 * delta
	tables += baloons[2] - delta
	print(tables)


import bisect
import collections
import copy
import functools
import heapq
import itertools
import math
import random
import re
import sys
import time
import string
from typing import List
sys.setrecursionlimit(99999)
(r, g, b) = map(int, sys.stdin.readline().split())
ans = (r + g + b) // 3
x = [r, g, b]
x.sort()
ans = min(ans, x[0] + x[1])
print(ans)


a = [int(x) for x in input().split()]
a.sort()
if 2 * (a[0] + a[1]) <= a[2]:
	print(a[0] + a[1])
else:
	print((a[0] + a[1] + a[2]) // 3)


vs = list(map(int, input().split()))
print(min(sum(vs) // 3, sum(vs) - max(vs)))


temparr = input()
temparr = temparr.split()
(r, g, b) = (int(temparr[0]), int(temparr[1]), int(temparr[2]))
arr = []
arr.append(r)
arr.append(g)
arr.append(b)
arr = sorted(arr)
if r == 0 and b == 0 or (g == 0 and b == 0) or (r == 0 and g == 0):
	print(0)
elif r == 0 and b == 0 and (g == 0):
	print(0)
elif r == 0 or g == 0 or b == 0:
	maxfirst = arr[-1]
	maxsecond = arr[-2]
	firstans = min(maxfirst // 2, maxsecond)
	remainderfirst = maxfirst - 2 * firstans
	remaindersecond = maxsecond - firstans
	if remainderfirst == 1 and remaindersecond == 2:
		firstans += 1
	print(firstans)
elif (arr[0] + arr[1]) * 2 <= arr[2]:
	print(arr[0] + arr[1])
else:
	total = 0
	total += r
	total += g
	total += b
	avg = total // 3
	print(avg)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
import copy
import time
starttime = time.time()
mod = int(pow(10, 9) + 7)
mod2 = 998244353

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

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def L():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
try:
	sys.stdin = open('input.txt', 'r')
except:
	pass
(r, g, b) = map(int, input().split())
print(min(r + g, r + b, b + g, (r + b + g) // 3))
endtime = time.time()


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


(r, g, b) = map(int, input().split())
k = min(r + g, b + r, g + b, (r + g + b) // 3)
print(k)


a = list(map(int, input().split()))
ans = min(a)
a[0] -= ans
a[1] -= ans
a[2] -= ans
for i in a:
	if i == 0:
		a.remove(i)
if len(a) < 2:
	if len(a) == 0:
		print(ans)
		exit(0)
	else:
		ans += min(ans, max(a) // 3)
		print(ans)
		exit(0)
s2 = max(a)
s1 = min(a)
if s1 == s2:
	print((s1 + s2) // 3 + ans)
	quit(0)
ans2 = min(s1, s2 // 2)
s1 -= ans2
s2 -= ans2 * 2
ans += min(ans, s2 // 3)
s2 -= min(ans, s2 // 3) * 3
ans += ans2
ans += min(s1, (s1 + s2) // 3)
print(ans)


a = [int(y) for y in input().split()]
a.sort()
print(min(a[0] + a[1], (a[0] + a[1] + a[2]) // 3))


I = lambda : list(map(int, input().split()))
(r, g, b) = sorted(I())
an = max(r + (min(2 * (g - r), b - r) + g - r) // 3, (r + g + min(2 * (g + r), b) if r + g < b else b + min(2 * b, r + g)) // 3)
print(an)


import math, sys, bisect, heapq
from collections import defaultdict, Counter, deque
from itertools import groupby, accumulate
int1 = lambda x: int(x) - 1
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
ilele = lambda : map(int, input().split())
alele = lambda : list(map(int, input().split()))
ilelec = lambda : map(int1, input().split())
alelec = lambda : list(map(int1, input().split()))

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 Y(c):
	print(['NO', 'YES'][c])

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

def Yy(c):
	print(['No', 'Yes'][c])
(r, g, b) = ilele()
(r, g, b) = sorted([r, g, b])
print(min(r + g, (r + g + b) // 3))


(r, g, b) = map(int, input().strip().split())
total = r + g + b
print(min(total // 3, total - max(r, g, b)))


from sys import stdin, stdout, stderr
a = [int(x) for x in input().split()]
a.sort()
if a[0] + a[1] <= a[-1]:
	print(min(sum(a) // 3, a[0] + a[1]))
else:
	x = a[0] + a[1] - a[-1]
	if x <= a[-1]:
		print(int(x + (a[-1] - x) * 2 // 3))
	else:
		z = a[0] + a[1] - x * 2
		print(int(x + z // 3))


o = input().rstrip().split(' ')
o.sort(key=int)
print(min(int(o[0]) + int(o[1]), (int(o[0]) + int(o[1]) + int(o[2])) // 3))


(r, g, b) = map(int, input().split())
s = r + g + b
l = [r, g, b]
l.sort()
print(min(int(s / 3), l[0] + l[1]))


r_g_b = list(map(int, input().split(' ')))
print(int(min(sum(r_g_b) / 3, sum(r_g_b) - max(r_g_b))))


l = list(map(int, input().split()))
l = sorted(l)
k = 0
l1 = l[:]
may = min(l1) + min((l[1] + l[2] - min(l1) * 2) // 3, min(l[1] - l[0], l[2] - l[0]))
if l[0] != l[1]:
	t = l[2] - l[0]
	t1 = l[1] - l[0]
	l[2] = l[2] - min(t // 2, t1) * 2
	l[1] = l[1] - min(t // 2, t1)
	k = min(t // 2, t1)
l = sorted(l)
if l[0] != l[1]:
	t = l[2] - l[0]
	t1 = l[1] - l[0]
	l[2] = l[2] - min(t // 2, t1) * 2
	l[1] = l[1] - min(t // 2, t1)
	k = min(t // 2, t1) + k
l = sorted(l)
t = l[2] // 4
t1 = l[1]
l[0] = l[0] - min(t, t1)
l[1] = l[1] - min(t, t1)
l[2] = l[2] - min(t, t1) * 4
k = k + min(t, t1) * 2
k = k + min(l)
r = min(l)
l[0] = l[0] - r
l[1] = l[1] - r
l[2] = l[2] - r
l = sorted(l)
ma = (l[1] + l[2]) // 3
print(max(may, k + min(ma, min(l[1], l[2]))))


(r, g, b) = map(int, input().split())
z = min(r + g + b, 3 * min(r + b, g + b, g + r))
print(z // 3)


def main():
	number_of_ballons = list(map(int, input().split()))
	if max(number_of_ballons) >= 2 * (sum(number_of_ballons) - max(number_of_ballons)):
		print(sum(number_of_ballons) - max(number_of_ballons))
	else:
		print(int(sum(number_of_ballons) / 3))
main()


a = list(map(int, input().split()))
ans = sum(a)
print(min(ans // 3, ans - max(a)))


l = [int(i) for i in input().split()]
print(min(sum(l) // 3, sum(l) - max(l)))


colors = list(map(int, input().split(' ')))
colors.sort()
if colors[2] > 2 * (colors[1] + colors[0]):
	print(colors[1] + colors[0])
	exit()
colors[1] = colors[1] - colors[0]
colors[2] = colors[2] - colors[0]
print(colors[0] + int((colors[1] + colors[2]) / 3))


import math as mt
import collections as cc

def ncr(n, r):
	import math as mt
	return mt.factorial(n) // (mt.factorial(n - r) * mt.factorial(r))
I = lambda : list(map(int, input().split()))
(r, g, b) = sorted(I())
s = r + g + b
print(min(s // 3, s - b))


arr = list(map(int, input().split()))
s = sum(arr)
ans = min(s // 3, s - max(arr))
print(ans)


(r, g, b) = [int(i) for i in input().split()]
(r, g, b) = sorted([r, g, b])
if 2 * (r + g) <= b:
	print(r + g)
else:
	print((r + g + b) // 3)


(r, g, b) = list(map(int, input().split()))
a = [r, g, b]
a.sort()
if a[2] >= 2 * (a[0] + a[1]):
	print(a[0] + a[1])
else:
	print(sum(a) // 3)


a = tuple(map(int, input().split()))
print(min(sum(a) // 3, sum(a) - max(a)))


(red, green, blue) = [int(x) for x in input().split(' ')]
bot = min(red, green, blue)
top = max(red, green, blue)
mid = red + green + blue - bot - top
print(min(bot + mid, (bot + mid + top) // 3))


color = list(map(int, input().split()))
color = sorted(color)
if color[2] >= 2 * (color[0] + color[1]):
	print(color[0] + color[1])
else:
	summ = 0
	for i in color:
		summ += i
	print(summ // 3)


v = list(map(int, input().split()))
print(min(sum(v) // 3, sum(v) - max(v)))


l = sorted(list(map(int, input().split())))
if l[2] > (l[0] + l[1]) * 2:
	print(l[0] + l[1])
else:
	print((l[0] + l[1] + l[2]) // 3)


x = list(map(int, input().split()))
x.sort()
c = 0
for i in range(len(x)):
	if x[i] == 0:
		c += 1
if c < 2:
	if x[2] <= 2 * (x[1] + x[0]):
		print(sum(x) // 3)
	else:
		x[2] = 2 * (x[1] + x[0])
		print(sum(x) // 3)
else:
	print(0)


arr = list(map(int, input().split()))
arr.sort()
summ = arr[0] + arr[1] + arr[2]
print(min(int(summ / 3), arr[0] + arr[1]))


l = list(map(int, input().split()))
print(min(sum(l) // 3, sum(l) - max(l)))


rgb = input()
rgblist = rgb.split(' ')
rgblist = [int(i) for i in rgblist]
rgblist.sort()
rgblist.reverse()
semresto = sum(rgblist) // 3
comresto = sum(rgblist) - rgblist[0]
if semresto < comresto:
	print(semresto)
else:
	print(comresto)


from math import floor
a = list(map(int, input().split()))
a.sort()
r = a[2]
g = a[1]
b = a[0]
print(min(g + b, (r + g + b) // 3))


l = [int(i) for i in input().split()]
l.sort()
s = 0
if l[2] >= 2 * l[1] + 2 * l[0]:
	print(l[0] + l[1])
	exit()
for i in range(20):
	m = l[2] - l[1]
	a = m // 2
	a1 = a // 2
	a2 = a - a1
	l[2] = l[2] - 2 * a
	l[1] -= a2
	l[0] -= a1
	s += a
	l.sort()
s += l[0]
l[1] -= l[0]
l[2] -= l[0]
if 2 * l[1] <= l[2]:
	s += l[1]
else:
	s += (l[1] + l[2]) // 3
print(s)


l = list(map(int, input().split()))
l.sort()
(a, b, c) = l
m1 = a + b
m2 = min(2 * m1, c)
print((m1 + m2) // 3)


(x, y, z) = list(map(int, input().split()))
L = [x, y, z]
L.sort()
x = L[2]
y = L[1]
z = L[0]
n = 2 * y + 2 * z
a = -1
b = y + z + 1
while b - a > 1:
	e = (b + a) // 2
	if n - 2 * e <= x + e:
		b = e
	else:
		a = e
print(min((n - 2 * b) // 2, (x + b) // 2))


a = [int(i) for i in input().split()]
r = a[0]
g = a[1]
b = a[2]
(r, g, b) = (max(r, g, b), r + g + b - max(r, g, b) - min(r, g, b), min(r, g, b))
if r >= 2 * (g + b):
	print(g + b)
else:
	print((r + g + b) // 3)


def get_answer(a, b, c):
	return min((a + b + c) // 3, a + b + c - max(a, b, c))
(r, g, b) = map(int, input().split())
print(get_answer(r, g, b))


(x, y, z) = tuple(sorted(list(map(int, input().split()))))
print((x + y + z) // 3 if 2 * (x + y) >= z else x + y)


(r, g, b) = tuple(map(int, input().split()))
if r > 2 * (g + b):
	r = 2 * (g + b)
if b > 2 * (g + r):
	b = 2 * (g + r)
if g > 2 * (r + b):
	g = 2 * (r + b)
print(int((g + r + b) / 3))


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import ceil, floor
from copy import *
from collections import deque, defaultdict
from collections import Counter as counter
from itertools import combinations
from itertools import permutations as permutate
from bisect import bisect_left as bl
from operator import *
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192
from sys import stderr

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))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func

class SortedList:

	def __init__(self, iterable=[], _load=200):
		values = sorted(iterable)
		self._len = _len = len(values)
		self._load = _load
		self._lists = _lists = [values[i:i + _load] for i in range(0, _len, _load)]
		self._list_lens = [len(_list) for _list in _lists]
		self._mins = [_list[0] for _list in _lists]
		self._fen_tree = []
		self._rebuild = True

	def _fen_build(self):
		self._fen_tree[:] = self._list_lens
		_fen_tree = self._fen_tree
		for i in range(len(_fen_tree)):
			if i | i + 1 < len(_fen_tree):
				_fen_tree[i | i + 1] += _fen_tree[i]
		self._rebuild = False

	def _fen_update(self, index, value):
		if not self._rebuild:
			_fen_tree = self._fen_tree
			while index < len(_fen_tree):
				_fen_tree[index] += value
				index |= index + 1

	def _fen_query(self, end):
		if self._rebuild:
			self._fen_build()
		_fen_tree = self._fen_tree
		x = 0
		while end:
			x += _fen_tree[end - 1]
			end &= end - 1
		return x

	def _fen_findkth(self, k):
		_list_lens = self._list_lens
		if k < _list_lens[0]:
			return (0, k)
		if k >= self._len - _list_lens[-1]:
			return (len(_list_lens) - 1, k + _list_lens[-1] - self._len)
		if self._rebuild:
			self._fen_build()
		_fen_tree = self._fen_tree
		idx = -1
		for d in reversed(range(len(_fen_tree).bit_length())):
			right_idx = idx + (1 << d)
			if right_idx < len(_fen_tree) and k >= _fen_tree[right_idx]:
				idx = right_idx
				k -= _fen_tree[idx]
		return (idx + 1, k)

	def _delete(self, pos, idx):
		_lists = self._lists
		_mins = self._mins
		_list_lens = self._list_lens
		self._len -= 1
		self._fen_update(pos, -1)
		del _lists[pos][idx]
		_list_lens[pos] -= 1
		if _list_lens[pos]:
			_mins[pos] = _lists[pos][0]
		else:
			del _lists[pos]
			del _list_lens[pos]
			del _mins[pos]
			self._rebuild = True

	def _loc_left(self, value):
		if not self._len:
			return (0, 0)
		_lists = self._lists
		_mins = self._mins
		(lo, pos) = (-1, len(_lists) - 1)
		while lo + 1 < pos:
			mi = lo + pos >> 1
			if value <= _mins[mi]:
				pos = mi
			else:
				lo = mi
		if pos and value <= _lists[pos - 1][-1]:
			pos -= 1
		_list = _lists[pos]
		(lo, idx) = (-1, len(_list))
		while lo + 1 < idx:
			mi = lo + idx >> 1
			if value <= _list[mi]:
				idx = mi
			else:
				lo = mi
		return (pos, idx)

	def _loc_right(self, value):
		if not self._len:
			return (0, 0)
		_lists = self._lists
		_mins = self._mins
		(pos, hi) = (0, len(_lists))
		while pos + 1 < hi:
			mi = pos + hi >> 1
			if value < _mins[mi]:
				hi = mi
			else:
				pos = mi
		_list = _lists[pos]
		(lo, idx) = (-1, len(_list))
		while lo + 1 < idx:
			mi = lo + idx >> 1
			if value < _list[mi]:
				idx = mi
			else:
				lo = mi
		return (pos, idx)

	def add(self, value):
		_load = self._load
		_lists = self._lists
		_mins = self._mins
		_list_lens = self._list_lens
		self._len += 1
		if _lists:
			(pos, idx) = self._loc_right(value)
			self._fen_update(pos, 1)
			_list = _lists[pos]
			_list.insert(idx, value)
			_list_lens[pos] += 1
			_mins[pos] = _list[0]
			if _load + _load < len(_list):
				_lists.insert(pos + 1, _list[_load:])
				_list_lens.insert(pos + 1, len(_list) - _load)
				_mins.insert(pos + 1, _list[_load])
				_list_lens[pos] = _load
				del _list[_load:]
				self._rebuild = True
		else:
			_lists.append([value])
			_mins.append(value)
			_list_lens.append(1)
			self._rebuild = True

	def discard(self, value):
		_lists = self._lists
		if _lists:
			(pos, idx) = self._loc_right(value)
			if idx and _lists[pos][idx - 1] == value:
				self._delete(pos, idx - 1)

	def remove(self, value):
		_len = self._len
		self.discard(value)
		if _len == self._len:
			raise ValueError('{0!r} not in list'.format(value))

	def pop(self, index=-1):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		value = self._lists[pos][idx]
		self._delete(pos, idx)
		return value

	def bisect_left(self, value):
		(pos, idx) = self._loc_left(value)
		return self._fen_query(pos) + idx

	def bisect_right(self, value):
		(pos, idx) = self._loc_right(value)
		return self._fen_query(pos) + idx

	def count(self, value):
		return self.bisect_right(value) - self.bisect_left(value)

	def __len__(self):
		return self._len

	def __getitem__(self, index):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		return self._lists[pos][idx]

	def __delitem__(self, index):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		self._delete(pos, idx)

	def __contains__(self, value):
		_lists = self._lists
		if _lists:
			(pos, idx) = self._loc_left(value)
			return idx < len(_lists[pos]) and _lists[pos][idx] == value
		return False

	def __iter__(self):
		return (value for _list in self._lists for value in _list)

	def __reversed__(self):
		return (value for _list in reversed(self._lists) for value in reversed(_list))

	def __repr__(self):
		return 'SortedList({0})'.format(list(self))
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def fsep():
	return map(float, inp().split())

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def pow(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res
from functools import reduce

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def gcd(a, b):
	if a == b:
		return a
	while b > 0:
		(a, b) = (b, a % b)
	return a

def prefix_sum(ar):
	return list(accumulate(ar))

def suffix_sum(ar):
	return list(accumulate(ar[::-1]))[::-1]

def N():
	return int(inp())
dx = [0, 0, 1, -1]
dy = [1, -1, 0, 0]

def YES():
	print('YES')

def NO():
	print('NO')

def Yes():
	print('Yes')

def No():
	print('No')
from collections import defaultdict

def numberOfSetBits(i):
	i = i - (i >> 1 & 1431655765)
	i = (i & 858993459) + (i >> 2 & 858993459)
	return ((i + (i >> 4) & 252645135) * 16843009 & 4294967295) >> 24

class MergeFind:

	def __init__(self, n):
		self.parent = list(range(n))
		self.size = [1] * n
		self.num_sets = n

	def find(self, a):
		to_update = []
		while a != self.parent[a]:
			to_update.append(a)
			a = self.parent[a]
		for b in to_update:
			self.parent[b] = a
		return self.parent[a]

	def merge(self, a, b):
		a = self.find(a)
		b = self.find(b)
		if a == b:
			return
		self.num_sets -= 1
		self.parent[a] = b
		self.size[b] += self.size[a]

	def set_size(self, a):
		return self.size[self.find(a)]

	def __len__(self):
		return self.num_sets

def lcm(a, b):
	return abs(a // gcd(a, b) * b)

def solve():
	ar = lis()
	ar.sort()
	if ar[2] > 2 * (ar[0] + ar[1]):
		ar[2] = 2 * (ar[0] + ar[1])
	print(sum(ar) // 3)
solve()


l = list(map(int, input().split()))
l.sort()
if 2 * (l[0] + l[1]) <= l[2]:
	num = l[0] + l[1]
else:
	num = int(sum(l) // 3)
print(num)


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


import sys, math, itertools, random, bisect
from collections import defaultdict
INF = 10 ** 18

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

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

def input():
	return sys.stdin.readline().strip()
mod = 10 ** 9 + 7
test = 1
for _ in range(test):
	a = get_array()
	if max(a) >= 2 * (sum(a) - max(a)):
		print(sum(a) - max(a))
	else:
		print(sum(a) // 3)


def zhouquan(a, b):
	if b >= 4 * a:
		return 2 * a
	else:
		return 2 * int((b - a) / 3) + a - int((b - a) / 3)
(a, b, c) = sorted([int(i) for i in input().split()])
if a == b:
	result = zhouquan(a, c)
elif (c - a) / (b - a) < 2:
	result = int((c + b - 2 * a) / 3) + a
else:
	result = b - a + zhouquan(a, c - 2 * (b - a))
print(result)


entrada = list(map(int, input().split()))
entrada.sort()
ans = min(entrada[0] + entrada[1], (entrada[0] + entrada[1] + entrada[2]) / 3)
print(int(ans))


c = list(map(int, input().split()))
c.sort()
ans = 0
while True:
	if c[1] == 0 and c[0] == 0:
		break
	if max(c) - min(c) <= 1:
		ans += sum(c) // 3
		break
	elif c[1] == c[0]:
		if c[0] > 100000 and c[1] > 100000 and (c[2] > 200000):
			c[2] -= 80000
			c[1] -= 20000
			c[0] -= 20000
			c.sort()
			ans += 40000
		elif c[2] > 200000 and c[1] > 100000:
			c[2] -= 60000
			c[1] -= 30000
			c.sort()
			ans += 30000
		else:
			c[2] -= 2
			c[1] -= 1
			c.sort()
			ans += 1
	elif c[0] > 100000 and c[1] > 100000 and (c[2] > 200000):
		c[2] -= 60000
		c[1] -= 30000
		c.sort()
		ans += 30000
	elif c[2] > 200000 and c[1] > 100000:
		c[2] -= 60000
		c[1] -= 30000
		c.sort()
		ans += 30000
	else:
		c[2] -= 2
		c[1] -= 1
		c.sort()
		ans += 1
print(ans)


p = list(map(int, input().split()))
p.sort()
(a, b, c) = (p[0], p[1], p[2])
s = a + b + c
s //= 3
print(min(a + b, s))


import sys

def main():
	fin = sys.stdin
	fout = sys.stdout
	(r, g, b) = map(int, fin.readline().split())
	(r, g, b) = (min(r, g, b), r + g + b - min(r, g, b) - max(r, g, b), max(r, g, b))
	ans = min(r + g, (r + g + b) // 3)
	print(ans)
	fin.close()
	fout.close()
main()


(r, g, b) = map(int, input().split())
if r > 2 * (g + b):
	k = g + b
elif g > 2 * (r + b):
	k = r + b
elif b > 2 * (r + g):
	k = r + g
else:
	k = (r + g + b) // 3
print(k)


arr = [int(x) for x in input().split()]
arr.sort()
print(min(arr[1] + arr[0], sum(arr) // 3))


def solve(a):
	a = sorted(a)
	tmp = sum(a)
	if a[-1] >= 2 * (tmp - a[-1]):
		return tmp - a[-1]
	return tmp // 3

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


def solve(a):
	a = sorted(a)
	return min(a[0] + a[1], sum(a) // 3)
(r, g, b) = map(int, input().split())
print(solve([r, g, b]))


(r, g, b) = sorted(list(map(int, input().split())))
print(min([(r + g + b) // 3, r + g]))


a = sorted(map(int, input().split()))
print(min(sum(a) // 3, a[0] + a[1]))


import sys, math
reader = (line.rstrip() for line in sys.stdin)
input = reader.__next__

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())
import collections as col

def solve():
	B = getInts()
	B.sort()
	if B[0] == B[2]:
		return B[0]
	ans = 0
	if B[2] - B[1] <= B[1] - B[0]:
		return sum(B) // 3
	diff = B[1] - B[0]
	B[1] = B[0]
	B[2] -= 2 * diff
	ans += diff
	B[2] = min(B[2], 4 * B[0])
	return ans + sum(B) // 3
print(solve())


a = sorted(map(int, input().split()))
if (a[0] + a[1]) * 2 < a[2]:
	print(a[0] + a[1])
else:
	print(sum(a) // 3)


import sys
from math import ceil, floor

def main():
	(r, g, b) = [int(i) for i in input().split()]
	print(r + g + b - max(r, g, b) if max(r, g, b) >= 2 * (r + g + b - max(r, g, b)) else floor((r + g + b) / 3))
main()


inp = sorted(list((int(x) for x in input().split())))
print(min(sum(inp) // 3, inp[0] + inp[1]))


(r, g, b) = [int(i) for i in input().split(' ')]
A = [r, g, b]
A.sort()
print(min(sum(A) // 3, A[0] + A[1]))


(r, g, b) = sorted(map(int, input().split()))
left = 0
right = b + 1
while right - left > 1:
	m = (right + left) // 2
	if m + min(m, b - m) + r + g >= 3 * m:
		left = m
	else:
		right = m
print(left)


from sys import stdin
import math
arr = list(map(int, stdin.readline().split()))
arr.sort(reverse=True)
if max(arr) > 2 * (sum(arr) - max(arr)):
	print(arr[1] + arr[2])
else:
	print(sum(arr) // 3)


import sys
input = sys.stdin.readline
t = list(map(int, input().split()))
t.sort()
t[2] = min(t[2], (t[0] + t[1]) * 2)
print(sum(t) // 3)


def solve():
	(r, g, b) = map(int, input().split())
	res = max(r, g, b)
	if res > 2 * (r + g + b - max(r, g, b)):
		print(r + g + b - max(r, g, b))
	else:
		print((r + g + b) // 3)
solve()


a = list(sorted(list(map(int, input().split())), reverse=True))
if a[0] >= (a[1] + a[2]) * 2:
	print(a[1] + a[2])
else:
	print((a[0] + a[1] + a[2]) // 3)


l = list(map(int, input().split()))
(r, g, b) = (l[0], l[1], l[2])
print(min((r + g + b) // 3, r + b + g - max(l)))


(in1, in2, in3) = map(int, input().split())
r = min(in1 + in2, in1 + in3, in3 + in2, (in1 + in3 + in2) // 3)
print(r)


inputlist = list(map(int, input().split()))
import math
r = inputlist[0]
b = inputlist[1]
g = inputlist[2]
a = max(r, b, g)
c = min(r, b, g)
b = r + b + g - (a + c)
if a >= 2 * (b + c):
	print(b + c)
else:
	print(math.floor((a + b + c) / 3))


lista = list(map(int, input().split()))
maior = max(lista)
menor = min(lista)
soma = sum(lista)
if maior > 2 * soma // 3:
	print(soma - maior)
else:
	print(soma // 3)


import sys
(r, g, b) = map(int, input().split())
(x, y, _) = sorted([r, g, b])
print(min(int((r + g + b) / 3), x + y))


a = [int(x) for x in input().split()]
r = a[0]
b = a[1]
g = a[2]
print(min(r + g, r + b, b + g, (r + b + g) // 3))


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

def srt(l):
	l.sort(reverse=True)
	return [l[0], l[1], l[2]]
(r, g, b) = srt([r, g, b])
if r >= 2 * (g + b):
	print(g + b)
else:
	print(int((r + b + g) / 3))


import sys
color = list(map(int, sys.stdin.readline().split()))
color.sort()
if color[2] > 2 * (color[0] + color[1]):
	color[2] = 2 * (color[0] + color[1])
print(sum(color) // 3)


a = []
a = list(map(int, input().split()))
a.sort()
mid = a[1]
if min(a) == 0:
	r = min(a)
if (min(a) + mid) * 2 > max(a):
	r = (max(a) + min(a)) // 3 + ((max(a) + min(a)) % 3 + mid) // 3
else:
	r = mid + min(a)
print(r)


l = list(map(int, input().split()))
l.sort()
if l[2] >= sum(l) * 2 / 3:
	print(sum(l) - l[2])
else:
	print(sum(l) // 3)


entrada = input().split(' ')
for i in range(len(entrada)):
	entrada[i] = int(entrada[i])
r = entrada[0]
g = entrada[1]
b = entrada[2]
soma = sum(entrada)
maior = max(entrada)
if maior >= 2 / 3 * soma:
	print(soma - maior)
else:
	print(soma // 3)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
import random
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
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 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 main():
	a = sorted(LI())
	if a[2] > (a[0] + a[1]) * 2:
		return a[0] + a[1]
	return sum(a) // 3
print(main())


import sys
import math as mt
input = sys.stdin.buffer.readline
mod = 998244353

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p
t = 1
for _ in range(t):
	l = list(map(int, input().split()))
	l.sort()
	if 2 * (l[0] + l[1]) <= l[2]:
		ans = l[0] + l[1]
	else:
		ans = sum(l[:]) // 3
	print(ans)


balloon = [int(x) for x in input().split()]
balloon.sort()
balloon[2] = min(balloon[2], 2 * (balloon[0] + balloon[1]))
print(sum(balloon) // 3)


colors = [int(e) for e in input().split()]
colors.sort()
result = min(colors[0] + colors[1], sum(colors) // 3)
print(result)


arr = list(map(int, input().split()))
arr.sort()
(a, b, c) = (arr[2], arr[1], arr[0])
print(min((a + b + c) // 3, b + c))


s = sorted(list(map(int, input().split(' '))))
a = s[0]
b = s[1]
c = s[2]
count = 0
if 2 * (a + b) <= c:
	count = a + b
else:
	count = (a + b + c) // 3
print(count)


rgb = sorted(map(int, input().split()))
res = min(rgb[0] + rgb[1], (rgb[0] + rgb[1] + rgb[2]) // 3)
print(res)


import math, re, sys, string, operator, functools, fractions, collections
sys.setrecursionlimit(10 ** 7)
RI = lambda x=' ': list(map(int, input().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
pi = math.acos(-1.0)
MAX = 10 ** 18
v = RI()
s = sum(v)
print(min(s // 3, s - max(v)))


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


a = [int(x) for x in input().split()]
result = sum(a) // 3
b = sorted(a)
if result > b[0] + b[1]:
	result = b[0] + b[1]
print(result)


(r, g, b) = [int(x) for x in input().split()]
ans = min((r + g + b) // 3, r + g + b - max(r, g, b))
print(ans)


a = list(map(int, input().split()))
a.sort()
s = a[0]
x = min(sum(a) // 3, a[0] + a[1])
print(int(x))


import sys
input = lambda : sys.stdin.readline().strip()

def bsearch(L, R, can, left_feasible=True):
	while R - L > 1:
		M = L + (R - L) // 2
		if can(M) ^ left_feasible:
			R = M
		else:
			L = M
	return L if left_feasible else R
(r, g, b) = [int(x) for x in input().split()]

def can(k):
	return min(r, 2 * k) + min(g, 2 * k) + min(b, 2 * k) >= 3 * k
print(bsearch(0, r + g + b, can))


(x, y, z) = map(int, input().split())
if x == y == 0 or y == z == 0 or x == z == 0:
	print('0')
elif x == 0 or y == 0 or z == 0:
	if x == 0:
		print(min(y, z, (y + z) // 3))
	elif y == 0:
		print(min(x, z, (x + z) // 3))
	else:
		print(min(y, x, (y + x) // 3))
else:
	print(min(x + y + z - max(x, y, z), (x + y + z) // 3))


A = list(map(int, input().split()))
A.sort()
if A[2] >= 2 * A[1] + 2 * A[0]:
	print(A[1] + A[0])
else:
	print((A[0] + A[1] + A[2]) // 3)


import math
(r, g, b) = map(int, input().split())
sum = 0

def solve_two_repeated_ballons(repeated_ball, other_ball):
	sum = 0
	if other_ball > repeated_ball:
		sum += repeated_ball
		if other_ball > repeated_ball * 4:
			sum += math.floor(repeated_ball * 4 / 3)
		else:
			sum += math.floor((other_ball - repeated_ball) / 3)
	else:
		sum += other_ball + math.floor((repeated_ball - other_ball) * 2 / 3)
	return sum
if r == g == b:
	sum += r
elif r == g and r != 0:
	sum += solve_two_repeated_ballons(r, b)
elif r == b and r != 0:
	sum += solve_two_repeated_ballons(r, g)
elif g == b and g != 0:
	sum += solve_two_repeated_ballons(g, r)
elif r != g and r != b and (g != b):
	list_RGB = [r, g, b]
	list_RGB.sort()
	if list_RGB[2] >= (list_RGB[0] + list_RGB[1]) * 2:
		sum += list_RGB[0] + list_RGB[1]
	else:
		sum += list_RGB[0]
		sum += math.floor((list_RGB[1] + list_RGB[2] - 2 * list_RGB[0]) / 3)
print(int(sum))


a = list(map(int, input().split()))
a.sort()
if a[0] == 0 and a[1] <= a[2] / 2:
	print(a[1])
	exit()
elif a[0] == 0:
	print(a[2] - a[1] + 2 * (2 * a[1] - a[2]) // 3)
	exit()
if sum(a) - a[2] <= a[2] / 2:
	print(a[0] + a[1])
	exit()
k = a[2]
a[2] -= sum(a) % 3
k = k - a[2]
x = (a[2] + a[0] - 2 * a[1]) // 3
y = (a[2] + a[1] - 2 * a[0]) // 3
a[0] -= x
a[2] = a[1] = a[0]
if a[2] % 3 != 1:
	print(x + y + a[2])
elif k != 0:
	print(x + y + a[0])
elif x <= 0:
	print(x + y + a[0])
else:
	print(x + y + a[0] - 1)


from math import *
a = list(map(int, input().split()))
a.sort()
if a[0] + a[0] + a[1] + a[1] < a[2]:
	print(a[0] + a[1])
else:
	print((a[0] + a[1] + a[2]) // 3)


arr = list(map(int, input().split()))
arr.sort()
r = 0
v = min(arr[2] - arr[1], arr[1] - arr[0])
arr[2] -= v * 2
arr[1] -= v
r += v
if arr[0] == arr[1] == arr[2]:
	r += arr[0]
	arr[0] = 0
	arr[1] = 0
	arr[2] = 0
elif arr[1] == arr[2]:
	v = (arr[1] - arr[0]) // 3
	r += v * 2
	arr[1] -= v * 3
	arr[2] -= v * 3
elif arr[0] == arr[1]:
	v = min(arr[0], (arr[2] - arr[1]) // 3)
	r += v * 2
	arr[2] -= v * 4
	arr[1] -= v
	arr[0] -= v
v = arr[0]
r += v
arr[0] -= v
arr[1] -= v
arr[2] -= v
if arr == [0, 2, 2]:
	r += 1
print(r)


from collections import defaultdict, deque, Counter, OrderedDict
from bisect import insort, bisect_right, bisect_left
import threading, sys

def main():
	(r, g, b) = sorted(map(int, input().split()), key=lambda x: -x)
	if (g + b) * 2 >= r:
		print((r + b + g) // 3)
	else:
		print(g + b)
thread = threading.Thread(target=main)
thread.start()


ans = 0
arr = [int(i) for i in input().split()]
arr.sort()
if arr[1] + arr[0] <= arr[2] // 2:
	ans = arr[0] + arr[1]
else:
	ans = sum(arr) // 3
print(ans)


bs = sorted(map(int, input().split()))
print(min(sum(bs) // 3, bs[0] + bs[1]))


I = lambda : int(input())
IL = lambda : list(map(int, input().split()))
(a, b, c) = sorted(IL())
c = min((a + b) * 2, c)
print((a + b + c) // 3)


(r, g, b) = map(int, input().split())
print(min((r + g + b) // 3, r + g + b - max(r, g, b)))


import math
from decimal import *
getcontext().prec = 30
c = list(map(int, input().split()))
c.sort()
if c[2] >= (c[0] + c[1]) * 2:
	print(c[0] + c[1])
else:
	print(sum(c) // 3)


a = list(map(int, input().split()))
a.sort()
sans = int(sum(a) / 3)
ans = min(sans, sum(a[0:2]))
print(ans)


ls = [int(x) for x in input().split()]
ls.sort()
(r, g, b) = ls
if 2 * (r + g) >= b:
	print((r + g + b) // 3)
else:
	print(r + g)


(r, g, b) = map(int, input().split())
l = sorted([r, g, b])
(a, b, c) = l
if c - a <= 1:
	print((a + b + c) // 3)
elif c >= 2 * (a + b):
	print(a + b)
else:
	print((a + b + c) // 3)


def compute(a, b):
	if b >= 2 * a:
		return a
	elif b == a:
		if a % 3 == 0 or a % 3 == 1:
			return 2 * (a // 3)
		else:
			return 2 * (a // 3) + 1
	else:
		ans = b - a
		if (2 * a - b) % 3 == 0 or (2 * a - b) % 3 == 1:
			ans += 2 * ((2 * a - b) // 3)
		else:
			ans += 2 * ((2 * a - b) // 3) + 1
		return ans
arr = [int(i) for i in input().split()]
arr.sort()
a = arr[0]
b = arr[1]
c = arr[2]
if arr.count(0) >= 2:
	print(0)
elif arr.count(0) == 1:
	if a == 0:
		print(compute(b, c))
	elif b == 0:
		print(compute(a, c))
	else:
		print(compute(a, b))
elif c - b <= 1:
	if b + c - 2 * a < 3:
		print(a)
	else:
		print(a + compute(b - a, c - a))
elif min((c - b) // 2, a) == a:
	print(a + compute(b, c - 2 * a))
else:
	ans = (c - b) // 2
	a = a - (c - b) // 2
	c = c - 2 * ((c - b) // 2)
	if b + c - 2 * a < 3:
		print(a + ans)
	else:
		print(a + ans + compute(b - a, c - a))


def solve():
	(i, j, k) = map(int, input().split())
	lst = [i, j, k]
	lst.sort()
	target = sum(lst) / 3
	if lst[0] + lst[1] < target:
		print(lst[0] + lst[1])
	else:
		print(int(sum(lst) / 3))
solve()


(a, b, c) = list(map(int, input().split()))
s = a + b + c
print(min(s - max(a, b, c), s // 3))


import sys, math
(a, b, c) = input().split()
a = int(a)
b = int(b)
c = int(c)
l = max(a, max(b, c))
sys.stdout.write(str(min((a + b + c) // 3, a + b + c - l)))


import sys
sys.setrecursionlimit(10 ** 5 + 1)
inf = int(10 ** 20)
max_val = inf
min_val = -inf
RW = lambda : sys.stdin.readline().strip()
RI = lambda : int(RW())
RMI = lambda : [int(x) for x in sys.stdin.readline().strip().split()]
RWI = lambda : [x for x in sys.stdin.readline().strip().split()]
rgb = RMI()
print(min(sum(rgb) // 3, sum(rgb) - max(rgb)))


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

def II():
	return int(stdin.readline())

def IO():
	return stdin.readline()

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

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

def P(x):
	return stdout.write(str(x))

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

def lcm(a, b):
	return a * b // gcd(a, b)

def gcd(a, b):
	if a == 0:
		return b
	elif b == 0:
		return a
	if a > b:
		return gcd(a % b, b)
	else:
		return gcd(a, b % a)

def readTree():
	v = int(input())
	adj = [set() for i in range(v + 1)]
	for i in range(v - 1):
		(u1, u2) = In()
		adj[u1].add(u2)
		adj[u2].add(u1)
	return (adj, v)

def bfs(adj, v):
	visited = [False] * (v + 1)
	q = deque()
	while q:
		pass

def sieve():
	li = [True] * 1000001
	(li[0], li[1]) = (False, False)
	for i in range(2, len(li), 1):
		if li[i] == True:
			for j in range(i * i, len(li), i):
				li[j] = False
	prime = []
	for i in range(1000001):
		if li[i] == True:
			prime.append(i)
	return prime

def setBit(n):
	count = 0
	while n != 0:
		n = n & n - 1
		count += 1
	return count

def solve():
	li = L()
	li.sort(reverse=True)
	(r, g, b) = li
	if r >= 2 * (g + b):
		print(g + b)
	else:
		print((r + g + b) // 3)
solve()


(r, g, b) = [int(i) for i in input().split()]
m = max(r, g, b)
if m > 2 * (r + g + b - m):
	print(r + g + b - m)
else:
	print((r + g + b) // 3)


import sys
inf = float('inf')
(mod, MOD) = (1000000007, 998244353)

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

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

def input():
	return sys.stdin.readline().strip()
Arr = get_array()
Arr.sort()
if max(Arr) >= 2 * (sum(Arr) - max(Arr)):
	print(Arr[0] + Arr[1])
else:
	print(sum(Arr) // 3)


rgb = []
rgb = list(map(int, input().split()))
l = len(rgb)
sum = 0
rgb.sort()
res = min(rgb[0] + rgb[1], (rgb[0] + rgb[1] + rgb[2]) // 3)
print(res)


a = list(map(int, input().split()))
a.sort()
if a[2] >= (a[0] + a[1]) * 2:
	ans = a[0] + a[1]
else:
	ans = (a[0] + a[1] + a[2]) // 3
print(ans)


list_ = list(map(int, input().split()))
sorted_list = sorted(list_)
(min_, mid_, max_) = (sorted_list[0], sorted_list[1], sorted_list[2])
t_1 = min_
t_2 = int(2 * (mid_ - min_) / 3)
t_3 = int(t_2 / 2) + t_1
tot_rest = (2 * mid_ + min_) % 3 + (max_ - mid_) % 3
print(t_1 + t_2 + sorted([int((max_ - mid_) / 3), t_3])[0] + ((2 * mid_ + min_) % 3 >= 1) * (max(tot_rest, max_ - mid_ - t_1 - t_2 - t_3) >= 3))


def main():
	(r, g, b) = map(int, input().split(' '))
	mx = max(r, g, b)
	s = sum([r, g, b])
	if mx > 2 * s / 3:
		print(s - mx)
	else:
		print(s // 3)
main()


def table_decorations(r, g, b):
	max_num = max(r, g, b)
	sum_num = r + g + b
	the_rest = sum_num - max_num
	if max_num > 2 * the_rest:
		wasted = max_num - 2 * the_rest
		sum_num -= wasted
	return sum_num // 3
(r, g, b) = map(int, input().strip().split())
print(table_decorations(r, g, b))


a = list(map(int, input().split()))
if max(a) >= 2 * (sum(a) - max(a)):
	print(sum(a) - max(a))
else:
	print(sum(a) // 3)


def main():
	from bisect import bisect_left as bl, bisect_right as br, insort
	import sys, math
	from collections import defaultdict as dd, deque

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

	def mdata():
		return list(map(int, data().split()))
	out = sys.stdout.write
	INF = float('INF')
	mod = int(1000000000.0) + 7
	l = mdata()
	l.sort()
	print(min((l[0] + l[1] + l[2]) // 3, l[0] + l[1]))
main()


from collections import deque, Counter, OrderedDict
from heapq import nsmallest, nlargest
from math import ceil, floor, log, log2, sqrt, gcd, factorial, pow, pi

def binNumber(n, size=4):
	return bin(n)[2:].zfill(size)

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

def ini():
	return int(input())

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

def sti():
	return str(input())

def par(a):
	print(' '.join(list(map(str, a))))

def tdl(outerListSize, innerListSize, defaultValue=0):
	return [[defaultValue] * innerListSize for i in range(outerListSize)]

def sts(s):
	s = list(s)
	s.sort()
	return ''.join(s)

class pair:

	def __init__(self, f, s):
		self.fi = f
		self.se = s

	def __lt__(self, other):
		return (self.fi, self.se) < (other.fi, other.se)
a = iar()
a.sort()
print(min(sum(a) // 3, sum(a[:2])))


vec = list(map(int, input().split(' ')))
vec.sort(reverse=True)
a = vec[0]
b = vec[1]
c = vec[2]
if a >= (b + c) * 2:
	ans = b + c
else:
	ans = (a + b + c) // 3
print(ans)


from __future__ import division, print_function
import math
import os
import sys
from fractions import *
from sys import *
from io import BytesIO, IOBase
from itertools import *
from collections import *
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
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')

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def fsep():
	return map(float, inp().split())

def inpu():
	return int(inp())

def regularbracket(t):
	p = 0
	for i in t:
		if i == '(':
			p += 1
		else:
			p -= 1
		if p < 0:
			return False
	else:
		if p > 0:
			return False
		else:
			return True

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] <= key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def reverse1(string):
	pp = ''
	for i in string[::-1]:
		pp += i
	if pp == string:
		return True
	return False

def reverse2(list1):
	l = []
	for i in list1[::-1]:
		l.append(i)
	if l == list1:
		return True
	return False

def mex(list1):
	p = max(list1) + 1
	for i in range(len(list1)):
		if list1[i] != i:
			p = i
			break
	return p

def sumofdigits(n):
	n = str(n)
	s1 = 0
	for i in n:
		s1 += int(i)
	return s1

def perfect_square(n):
	s = math.sqrt(n)
	if s == int(s):
		return True
	return False

def roman_number(x):
	if x > 15999:
		return
	value = [5000, 4000, 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]
	symbol = ['F', 'MF', 'M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I']
	roman = ''
	i = 0
	while x > 0:
		div = x // value[i]
		x = x % value[i]
		while div:
			roman += symbol[i]
			div -= 1
		i += 1
	return roman

def soretd(s):
	for i in range(1, len(s)):
		if s[i - 1] > s[i]:
			return False
	return True

def countRhombi(h, w):
	ct = 0
	for i in range(2, h + 1, 2):
		for j in range(2, w + 1, 2):
			ct += (h - i + 1) * (w - j + 1)
	return ct

def countrhombi2(h, w):
	return h * h // 4 * (w * w // 4)

def binpow(a, b):
	if b == 0:
		return 1
	else:
		res = binpow(a, b // 2)
	if b % 2 != 0:
		return res * res * a
	else:
		return res * res

def binpowmodulus(a, b, m):
	a %= m
	res = 1
	while b > 0:
		if b & 1:
			res = res * a % m
		a = a * a % m
		b >>= 1
	return res

def coprime_to_n(n):
	result = n
	i = 2
	while i * i <= n:
		if n % i == 0:
			while n % i == 0:
				n //= i
			result -= result // i
		i += 1
	if n > 1:
		result -= result // n
	return result

def prime(x):
	if x == 1:
		return False
	else:
		for i in range(2, int(math.sqrt(x)) + 1):
			if x % i == 0:
				return False
		else:
			return True

def luckynumwithequalnumberoffourandseven(x, n, a):
	if x >= n and str(x).count('4') == str(x).count('7'):
		a.append(x)
	elif x < 1000000000000.0:
		luckynumwithequalnumberoffourandseven(x * 10 + 4, n, a)
		luckynumwithequalnumberoffourandseven(x * 10 + 7, n, a)
	return a

def luckynuber(x, n, a):
	p = set(str(x))
	if len(p) <= 2:
		a.append(x)
	if x < n:
		luckynuber(x + 1, n, a)
	return a

def interact(type, x):
	if type == 'r':
		inp = input()
		return inp.strip()
	else:
		print(x, flush=True)

def mergeSort(arr):
	if len(arr) > 1:
		mid = len(arr) // 2
		L = arr[:mid]
		R = arr[mid:]
		mergeSort(L)
		mergeSort(R)
		i = j = k = 0
		while i < len(L) and j < len(R):
			if L[i] < R[j]:
				arr[k] = L[i]
				i += 1
			else:
				arr[k] = R[j]
				j += 1
			k += 1
		while i < len(L):
			arr[k] = L[i]
			i += 1
			k += 1
		while j < len(R):
			arr[k] = R[j]
			j += 1
			k += 1
res = set()

def solve(p, l, a, b, n):
	if p > n or l > 10:
		return
	if p > 0:
		res.add(p)
	solve(p * 10 + a, l + 1, a, b, n)
	solve(p * 10 + b, l + 1, a, b, n)

def colour(r, g, b, cnt):
	cnt += min(r, g, b)
	s = min(r, g, b)
	r -= s
	g -= s
	b -= s
	if r == 0:
		if g < b:
			ming = min(g, b // 2)
			cnt += ming
			g -= ming
			b -= ming * 2
			if g != 0 and b != 0 and (g != 1 or b != 1):
				colour(r, g, b, cnt)
			else:
				print(cnt)
				exit()
		else:
			ming = min(g // 2, b)
			cnt += ming
			g -= ming * 2
			b -= ming
			if g >= 1 and b >= 1 and (g != 1 or b != 1):
				colour(r, g, b, cnt)
			else:
				print(cnt)
				exit()
	elif g == 0:
		if r >= b:
			ming = min(r // 2, b)
			cnt += ming
			r -= ming * 2
			b -= ming
			if r != 0 and b != 0 and (r != 1 or b != 1):
				colour(r, g, b, cnt)
			else:
				print(cnt)
				exit()
		else:
			ming = min(r, b // 2)
			cnt += ming
			r -= ming
			b -= ming * 2
			if r != 0 and b != 0 and (r != 1 or b != 1):
				colour(r, g, b, cnt)
			else:
				print(cnt)
				exit()
	elif r >= g:
		ming = min(g, r // 2)
		cnt += ming
		g -= ming
		r -= ming * 2
		if g != 0 and r != 0 and (g != 1 or r != 1):
			colour(r, g, b, cnt)
		else:
			print(cnt)
			exit()
	else:
		ming = min(g // 2, r)
		cnt += ming
		g -= ming * 2
		r -= ming
		if g != 0 and r != 0 and (g != 1 or r != 1):
			colour(r, g, b, cnt)
		else:
			print(cnt)
			exit()

def main():
	(r, g, b) = sep()
	print(min(r + g, r + b, b + g, (r + b + g) // 3))
main()


def main():
	(r, g, b) = sorted(map(int, input().split()))
	print(r + g if (r + g) * 2 < b else (r + g + b) // 3)
main()


from io import BytesIO, IOBase
from math import sqrt
import sys, os
from os import path
inpl = lambda : list(map(int, input().split()))
inpm = lambda : map(int, input().split())
inpi = lambda : int(input())
inp = lambda : input()
(rev, ra, l) = (reversed, range, len)
P = print
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))

def input():
	return sys.stdin.readline().rstrip('\r\n')

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

def factors(n):
	arr = []
	for i in ra(2, int(sqrt(n)) + 1):
		if n % i == 0:
			arr.append(i)
			if i * i != n:
				arr.append(int(n / i))
	return arr

def dfs(arr, n):
	pairs = [[i + 1] for i in ra(n)]
	vis = [0] * (n + 1)
	for i in ra(l(arr)):
		pairs[arr[i][0] - 1].append(arr[i][1])
	pairs[arr[i][1] - 1].append(arr[i][0])
	comp = []
	for i in ra(n):
		stack = [pairs[i]]
		temp = []
		if vis[stack[-1][0]] == 0:
			while len(stack) > 0:
				if vis[stack[-1][0]] == 0:
					temp.append(stack[-1][0])
					vis[stack[-1][0]] = 1
					s = stack.pop()
					for j in s[1:]:
						if vis[j] == 0:
							stack.append(pairs[j - 1])
				else:
					stack.pop()
			comp.append(temp)
	return comp
from bisect import bisect_left as bl
from bisect import bisect_right as br
import sys, operator, math, operator
from collections import Counter
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
import random
li = inpl()
li.sort()
P(min(int(sum(li) // 3), li[0] + li[1]))


Ar = [int(x) for x in input().split()]
Ar.sort()
S = sum(Ar)
print(min(S // 3, Ar[0] + Ar[1]))


(r, g, b) = map(int, input().split())
les = min(r, g, b)
mor = max(r, g, b)
mid = r + g + b - les - mor
tables = 0
table = 0
if mor > 2 * (mid + les):
	tables = mid + les
else:
	tables = (r + g + b) // 3
print(tables)


l = list(map(int, input().split()))
l.sort(reverse=True)
(r, g, b) = l[:]
if (g + b) * 2 >= r:
	print((r + g + b) // 3)
else:
	print(g + b)


(*col,) = map(int, input().split())
result = sum(col) // 3
col.sort()
if col[0] + col[1] < result:
	result = col[0] + col[1]
print(result)


def solve(values):
	count = 0
	while True:
		values = sorted([v for v in values if v > 0])
		if sum(values) < 3 or len(values) < 2:
			break
		if len(values) == 3:
			if max(values) - min(values) <= 1:
				mv = min(values)
				count += mv
				values = [v - mv for v in values if v > 0]
			else:
				difference = (max(values) - min(values)) // 2
				steps = max(min(values[1], difference) // 2, 1)
				count += steps
				values[1] -= steps
				values[2] -= steps * 2
		else:
			difference = min(values[0], values[1] // 2)
			count += difference
			values[0] -= difference
			values[1] -= difference * 2
	return count
print(solve(map(int, input().split())))


[r, g, b] = [int(k) for k in input().split()]
color = [r, g, b]
color.sort()
if color[0] + color[1] <= int(color[2] / 2):
	count = color[0] + color[1]
else:
	count = int((color[0] + color[1] + color[2]) / 3)
print(count)


(r, g, b) = input().split(' ')
r = int(r)
g = int(g)
b = int(b)
resultado = 0
v = [r, g, b]
v.sort()
if v[2] > 2 * v[0] + 2 * v[1]:
	resultado += v[0] + v[1]
else:
	resultado = int(sum(v) / 3)
print(resultado)


(r, g, b) = map(int, input().split())
x = min(r, g, b)
z = max(r, g, b)
y = r + g + b - x - z
print(min((x + y + z) // 3, x + y))


things = sorted([int(x) for x in input().split()])
print(min(sum(things) // 3, things[0] + things[1]))


sp = sorted(list(map(int, input().split())))
sp[2] = min(sp[2], (sp[0] + sp[1]) * 2)
print(sum(sp) // 3)


l = input().split()
l[0] = int(l[0])
l[1] = int(l[1])
l[2] = int(l[2])
l.sort()
ans = l[0] + l[1]
if l[2] >= 2 * (l[0] + l[1]):
	print(ans)
else:
	ans = (l[0] + l[1] + l[2]) // 3
	print(ans)


import sys
fin = sys.stdin
fout = sys.stdout
a = list(map(int, fin.readline().strip().split()))
a.sort()
ans = 0
t = min(a[0], (a[2] - a[1]) // 2)
ans += t
a[0] -= t
a[2] -= 2 * t
ans += a[0]
a[1] -= a[0]
a[2] -= a[0]
t = min(a[1], a[2] - a[1])
ans += t
a[1] -= t
a[2] -= 2 * t
t = a[1] // 3 * 2
ans += t
a[1] -= t // 2 * 3
a[2] -= t // 2 * 3
if a[1] > 0 and a[1] + a[2] >= 3:
	ans += 1
print(str(ans), file=fout)


import itertools, functools, math

def solve():
	a = list(map(int, input().split()))
	a.sort()
	return min(sum(a) // 3, a[0] + a[1])
print(solve())


(r, g, b) = map(int, input().split())
a = [r, g, b]
ans = sum(a) // 3
a.sort()
if a[0] + a[1] < ans:
	ans = a[0] + a[1]
print(ans)


l = [int(x) for x in input().split()]
l.sort()
s = sum(l)
a = int(s / 3)
s -= l[2]
if s < a:
	print(s)
else:
	print(a)


def two(a, b):
	return min(a, b, (a + b) // 3)
z = list(map(int, input().split()))
z.sort()
if z[2] - 2 * z[0] >= z[1]:
	z[2] -= 2 * z[0]
	print(z[0] + two(z[1], z[2]))
else:
	y = 2 * z[0] + z[2] - z[1]
	if y % 2 == 0:
		y = y // 2
		x = 2 * z[0] - y
		print(z[0] + two(z[1] - x, z[2] - y))
	else:
		ans1 = 0
		y = y // 2
		x = 2 * z[0] - y
		ans2 = 0
		if min(z[1] - x, z[2] - y) >= 0:
			ans1 = z[0] + two(z[1] - x, z[2] - y)
		y += 1
		x = 2 * z[0] - y
		if min(z[1] - x, z[2] - y) >= 0:
			ans2 = z[0] + two(z[1] - x, z[2] - y)
		print(max(ans1, ans2))


a = [int(i) for i in input().split()]
a1 = min(a)
a.remove(a1)
a2 = min(a)
a3 = max(a)
a.remove(a2)
a.remove(a3)
tables = 0
tables = (a1 + a2 + a3) // 3 if (a1 + a2 + a3) // 3 < a1 + a2 else a1 + a2
print(tables)


(r, g, b) = input().split()
(r, g, b) = reversed(sorted([int(r), int(g), int(b)]))
if r >= 2 * (g + b):
	print(g + b)
else:
	print((r + g + b) // 3)


import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
a = list(map(int, input().split()))
a.sort()
if a[2] > 2 * (a[0] + a[1]):
	print(a[0] + a[1])
else:
	print(sum(a) // 3)


l = lambda : map(int, input().split())
li = list(l())
li.sort()
res = sum(li) // 3
res = min(res, li[0] + li[1])
print(res)