fun main(args:Array<String>) {
	val abc = readLine()!!.split(" ").map{ it.toInt() }
	val sum= abc.sum()
	val max=abc.max()!!
	
	if(sum%2==max%2) {
		println( (3*max-sum)/2 )
	}else{
		println( (3*(max+1)-sum)/2 )
	}
}