import Control.Applicative
import Data.List
main :: IO()
main = do
    a <- read <$> getLine
    b <- read <$> getLine
    c <- read <$> getLine
    d <- read <$> getLine
    print ((min a b) + (min c d))




