open System



[<EntryPoint>]
let main argv =
    let cube = stdin.ReadLine()
    let L = String.length cube
    cube
    |>Seq.sumBy(fun c -> (if c='0' then 1 else -1))
    |>fun c -> (L-(c|>abs))
    |>printfn "%d"
    0