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