import java.util.*

fun main(args: Array<String>) {

    val sc = Scanner(System.`in`)
    val S = sc.next()
    var isRun = true
    var pre = S.length
    var s = S
    while (true) {
        s = s.replace("01","")
        s = s.replace("10","")
        if (pre == s.length) break
        pre = s.length
    }
    println(S.length-s.length)
}