package main

import (
	"bufio"
	"fmt"
	"os"
)

func MinInts(nums ...int) int {
	var minVal int
	for i, e := range nums {
		if i == 0 || e < minVal {
			minVal = e
		}
	}
	return minVal
}

func ReadLine(f *os.File) string {
	reader := bufio.NewReader(f)
	bytes, _, _ := reader.ReadLine()

	return string(bytes)
}

func main() {
	str := ReadLine(os.Stdin)

	cnts := make([]int, 2)
	for _, c := range str {
		cnts[c-'0']++
	}
	fmt.Println(MinInts(cnts...) * 2)
}