{-# LANGUAGE OverloadedStrings #-}

import qualified Data.ByteString.Char8 as B
import Data.Attoparsec.ByteString.Char8

type Input = B.ByteString

input :: Parser B.ByteString
input = takeTill isSpace

main :: IO ()
main = B.interact
  $ B.pack . show . either (error "parse err") solve . parseOnly input

solve :: Input -> Int
solve xs = 2 * (ts `min` fs)
  where
    ts = B.length $ B.filter (== '1') xs
    fs = B.length $ B.filter (== '0') xs