stones = sorted([ int(v) for v in input().split() ]) def exchange(inlist): a, b, c = inlist if b != 0: d = min( ( c - a ) // 3, b) a, c = a + d, c - d * 2 d = a inlist = sorted([ i - a for i in [a,b,c] ]) else: d = c // 5 inlist = [0,0,(c-5*d)] return(inlist,d) ans = 0 product = 1 while product != 0: stones, product = exchange(stones) ans += product print(ans)