import Control.Arrow (second)
import Data.List
import qualified Data.Vector.Unboxed as V
import qualified Data.ByteString.Char8 as B

solve :: V.Vector Bool -> Int
solve xs = let _L = V.length xs; _M = V.length $ V.filter id xs in _L - abs (_L - 2 * _M)

main = do
  stringS <- B.getLine
  let xs = V.unfoldr (\n -> if n == B.length stringS then Nothing else Just (B.index stringS n == '0', n+1)) 0
  print $ solve xs

