r,b,w = map(int, input().split()) w -= abs(r-b) p = max(r,b) if w>0: p += w//2 else: p += w print(p)