x,y,z = [int(i) for i in input().split()] print(max(x + (z - (x-y))//2, y + (z-(y-x))//2))