# coding: utf-8 # Your code here! X,Y,Z=map(int,input().split()) X,Y=min(X,Y),max(X,Y) if abs(X-Y)>Z: print(X+Z) exit() else: Z-=(Y-X) print(Y+Z//2)