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.

Difficulty: interview

Starter code:

Solutions:
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)



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)


r,g,b=list(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())
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)

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)))

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)


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)

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)


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()))

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(' '))
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)

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)


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)


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]))

a, b, c = list(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))




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


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)


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)


#190 div 2 B. Ciel and Flowers

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)

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)
else:
        

        if(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)
                
        
        
        


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))


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))

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)))

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))

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))