L = list(map(int, input().split())) def is_ok(x): p = 0 q = 0 for l in L: if l >= x: p +=(l-x)//2 else: q += x-l if p >= q: return True else: return False ok = 0 ng = 10**18 while ok+1 < ng: c = (ok+ng)//2 if is_ok(c): ok = c else: ng = c print(ok)