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