import Control.Applicative ((<$>))
import Control.Monad (replicateM)

main :: IO ()
main = solve <$> replicateM 4 (read <$> getLine) >>= print

solve :: [Int] -> Int
solve [a, b, c, d] = min a b + min c d
