import java.util.*

fun main(arr:Array<String>) {
    val buttons = readLine()!!.split(" ").map { it.toInt()*-1 }
    val queue = PriorityQueue<Int>()
    queue.addAll(buttons)
    var ans = 0
    for(i in (1..2)) {
        var b = queue.poll() * -1
        ans += b
        b--
        if(b > 0) {
            queue.add(b*-1)
        }
    }
    println(ans)
}
