main = do cs <- getLine let [a, b, d] = map readInt $ words cs print $ length $ filter (\x -> 0 <= d - x && d - x <= abs(b)) [0..abs(a)] readInt :: String -> Int readInt = read