class Blocks(var s : String){
    var index = 0
    var del = 0

    fun deleteBlocks(){
        s = s.substring(0, index) + s.substring(index + 2)
        index = listOf(0, index - 1).max()!!
        del += 2
    }
}

fun solver(b : Blocks){
    while(b.s.length > b.index + 1){
        if(b.s[b.index] == '0' && b.s[b.index + 1] == '1') b.deleteBlocks()
        else if(b.s[b.index] == '1' && b.s[b.index + 1] == '0') b.deleteBlocks()
        else b.index++
    }
}

fun main(args: Array<String>){
    val b = Blocks(readLine()!!)
    solver(b)
    println(b.del)
}