fun main(args : Array<String>) {
    val (a1, a2, a3) = readLine()!!.split(" ").map { it.toInt() }
    val allList = listOf(
            Triple(a1, a2, a3),
            Triple(a1, a3, a2),
            Triple(a2, a1, a3),
            Triple(a2, a3, a1),
            Triple(a3, a1, a2),
            Triple(a3, a2, a1)
    )
    val minCost = allList.map {
        val (x1, x2, x3) = it
        x1 * 0 + Math.abs(x2 - x1) + Math.abs(x3 - x2)
    }.min()

    println(minCost)
}