module Main where
import Control.Exception (bracket, finally)
import Control.Monad (forM_)
import System.IO
import System.Environment

main :: IO ()
main = do
  a <- (read :: String -> Int) <$> getLine
  b <- (read :: String -> Int) <$> getLine
  c <- (read :: String -> Int) <$> getLine
  d <- (read :: String -> Int) <$> getLine

  print $ min a b + min c d 