{-# LANGUAGE OverloadedStrings #-}

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

type Input = [Bool]

input :: Parser [Bool]
input = map f <$> many1 digit <* endOfLine
  where
    f '1' = True
    f '0' = False
    f _ = error "parse err"

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 = length $ filter id xs
    fs = length $ filter not xs