fun main(arr:Array<String>) {
    var abc = readLine()!!.split(" ").map { it.toInt() }.sorted().toMutableList()
    val adda = abc.last() - abc.first()
    val addb = abc.last() - abc[1]
    var ans = Math.min(adda, addb)
    val tmp = Math.max(adda, addb) - ans
    if(tmp % 2 != 0) {
        ans+=2
    }
    ans += tmp / 2
    println(ans)

}
