import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val t = (1..3).map { sc.nextInt() }
    val max = t.max()!!
    var sumDiff = t.map { max - it }.sum()
    if (sumDiff % 2 != 0) {
        sumDiff += 3
    }
    println(sumDiff / 2)
}