x,y,z=map(int,input().split()) s=abs(x-y) z-=s print(int((z//2)+((x+y+s)/2)))