fun main(args: Array<String>) {
    abc093c()
}

fun abc093c() {
    var abc = readLine()!!.split(" ").map { it.toInt() }
        .sorted().toMutableList()

    var cnt = 0
    while (abc[0] != abc[1] || abc[1] != abc[2]) {
        if (abc[0] == abc[1]) {
            abc[0]++
            abc[1]++
        } else {
            abc[0] += 2
        }
        abc = abc.sorted().toMutableList()
        cnt++
    }

    println(cnt)
}
