
fun main(args:Array<String>) {
    var (A,B,C) = readLine()!!.split(" ").map(String::toInt).sorted()
    val offset = if(A % 2 != B % 2) {
        val tmp = (B-A) / 2 + 1
        C+=1
        A=B
        tmp
    } else {
        (B-A)/2
    }
    println(C-B + offset)
}