{-# LANGUAGE OverloadedStrings #-}

import Control.Monad
import Control.Applicative
import qualified Data.Text as T
import qualified Data.Text.IO as T

main :: IO()
main = do
    input <- map (read :: String -> Int) <$> replicateM 4 getLine
    putStrLn $ solve input

solve :: [Int] -> String
solve [a,b,c,d] = show $ (a `min` b) + (c `min` d) 