x, y, z = map(int, input().split()) if x > y: moto_ball = y amari = x-y elif x== y: moto_ball = y amari = 0 else: moto_ball = x amari=y-x if amari >= z: print(moto_ball+z) else:#amari < z z_z = z+amari #print("moto_ball",moto_ball) #print(z_z) print(moto_ball+(z_z//2))