
main = do
  abc <- map read . words <$> getLine :: IO [Int]
  let (a, b, c) = (head abc, abc!!1, last abc)
  print $ foo a b c
  where
    foo x y z
      | x <= y = z
      | x - y >= z = 0
      | otherwise = z - (x - y)

