import Foundation

var S = readLine()!
let SL = S.characters.count

while true {
    if let range = S.rangeOfString("10") {
        S.removeRange(range)
    } else if let range = S.rangeOfString("01") {
        S.removeRange(range)
    } else {
        break
    }
}
print(SL-S.characters.count)