function main(arg) {
	arg = arg.split("\n")[0].split(" ")
	var A = Number(arg[0]) // - 
	var B = Number(arg[1]) // + 
	var C = Number(arg[2]) // + *

	if ( A + B >= C) {
		console.log(B + C)
		return
	} else {
		var tmp = A + B
		console.log(B + tmp)
		return
	}

}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));