main = do
  a <- read <$> getLine
  b <- read <$> getLine
  c <- read <$> getLine
  d <- read <$> getLine
  putStrLn . show $ solve a b c d

solve :: Int -> Int -> Int -> Int -> Int
solve a b c d = (min a b) + (min c d)