x,y,z=map(int,input().split()) cnt=(x+y+z)//2 if z==0 : print(min(x,y)) exit() else: print(min(cnt,min(x,y)+z))