package main

import (
	"fmt"
	"strings"
)

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

	ans := 0
	for {
		if strings.Contains(s, "01") {
			s = strings.Replace(s, "01", "", 1)
			ans += 2
			continue
		}
		if strings.Contains(s, "10") {
			s = strings.Replace(s, "10", "", 1)
			ans += 2
			continue
		}
		break
	}
	fmt.Println(ans)
}
