main = do [x, y, d] <- getLine >>= return . map read . words print $ if x + y < d then 0 else if x >= d && y >= d then d + 1 else if x > d then y + 1 else if y > d then x + 1 else x + y - d + 1