stones = sorted([ int(v) for v in input().split() ]) def exchange(inlist): first_product, second_product, third_product = 0, 0, 0 a, b, c = inlist first_product = a a, b, c = 0, b-a, c-a if c <= b *3: second_product = ( b + c ) // 4 else: second_product = b c = c - 2*b third_product = c // 5 print(first_product+second_product+third_product) return exchange(stones)