fun main(args: Array<String>) {
	var (primaryCupLimit, primaryCupAmount, secondaryCupAmount) = readLine()!!.split(' ').map { it.toInt() }
    
    var primaryCupRemain = primaryCupLimit - primaryCupAmount
    var secondaryCupRemain = Math.max(secondaryCupAmount - primaryCupRemain, 0)
    
    System.out.println(secondaryCupRemain)
}
