import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val S = sc.next()
    println(solve(S))
  }

  def solve(S: String): String = {
    val arr = S.toArray
    val bl = arr.count(a => a == '1')
    val re = arr.count(a => a == '0')
    (S.length - Math.abs(bl - re)).toString
  }
}