import qualified Data.ByteString.Char8 as C
import Data.List

main = C.interact $ put . sol . get

get = unfoldr (C.readInt . C.dropWhile (==' ')) . last . C.lines

put = C.pack . show

sol = (\(a,b) -> length a+length b `div` 2*2) . break (==True) . 
  sort . fmap (even . length) . group . sort
