import java.io.FileInputStream
import java.util.*


fun Scanner.nextChar(): Char {
    val line = this.findInLine(".")
    return if (line == null) { // 改行のとき
        this.nextLine() // 改行読み捨て
        this.nextChar()
    }
    else {
        line[0]
    }
}

fun Scanner.nextIntList(size: Int): List<Int> {
    val list = mutableListOf<Int>()
    for (i in 1..size) {
        list.add(this.nextInt())
    }

    return list
}

inline fun Int.times(body: (index: Int) -> Unit) {
    var index = 0
    while (index < this) {
        body(index)
        index++
    }
}

inline fun <T> Int.map(body: (index: Int) -> T): List<T> {
    var index = 0
    val list = mutableListOf<T>()
    while (index < this) {
        list.add(body(index))
        index++
    }
    return list
}


var sc: Scanner = Scanner(System.`in`)
fun main(args: Array<String>) {
    if (args.size > 0) {
        System.setIn(FileInputStream(args[0]))
    }
    sc = Scanner(System.`in`)

    problem()

}

fun problem() {

    var list = sc.nextIntList(3)
    list = list.sorted()

    val count = list[2] - list[1]
    var count2 = (list[2] - list[0] - count) / 2
    var ans = count + count2
    if (list[0] + count2 * 2 + count < list[2]) {
        ans++
        count2 += 2
    }
    if (list[0] + count2 * 2 + count > list[2]) {
        ans++
    }

    println(ans)

}

