main = getLine >>= print . manhattan . map read . words manhattan [x,y,d] | d>x && d>y = 0 | otherwise = d - abs (x-y) + 1