from math import ceil ingre = map(int, raw_input().split()) ans = 0 while True: make = min(ingre) ans += make ingre = [i - make for i in ingre] if sum(ingre) <3: break else: maximum = max(ingre) transfer = int(ceil(maximum/6.0)) ingre[ingre.index(maximum)] -= transfer*2 ingre[ingre.index(0)] = transfer print ans