package main

import "fmt"

func solve(str []string) ([]string, bool) {
	var result []string
	for i := 0; i < len(str)-1; i++ {
		if str[i] == "0" && str[i+1] == "1" {
			// fmt.Println("str", str)
			result = append(str[:i], str[i+2:]...)
			// fmt.Println("res", result)
			return result, false
		}
	}
	return str, true
}

func main() {
	var S string
	var s []string
	fmt.Scan(&S)

	for _, c := range S {
		s = append(s, string([]rune{c}))
	}

	var flg bool
	var cnt int
	for {
		sLen := len(s)
		if sLen == 0 || sLen == 1 {
			break
		}
		s, flg = solve(s)

		if len(s) == sLen && flg {
			break
		}
		cnt++
	}

	// fmt.Println("s", s)
	fmt.Print(cnt * 2)

}
