s = list(map(int, input().split())) def check(mid): total = 0 excess=0 lack=0 for i in s: if i>=mid: excess=0 lack =0 excess = (i-mid)//2 if i=0 left = min(s) right = max(s) while True: mid = (left+right)//2 if check(mid)==True: left = mid else: right = mid if right==mid+1: break print(mid)