a,b,c=map(int,input().split()) d=max(a,b)-min(a,b) if d==a or d==b: print(0) else: print(max(c-d,0)//2+max(a,b))