
fun main(arr:Array<String>) {
    val (w,a,b) = readLine()!!.split(" ").map { it.toInt() }
    if(a <= b && b<= a+w) {
        println(0)
        return
    }
    if(b <= a && a <= b + w) {
        println(0)
        return
    }
    val ans = Math.min(Math.min(Math.abs(a+w-b), Math.abs(b+w-a)), Math.abs(a-b))
    println(ans)
}