open System
open System.Collections.Generic

let ReadOne T = stdin.ReadLine()|> T
let ReadSplit T = stdin.ReadLine().Split()|>Array.map T
[<EntryPoint>]
let main argv =
    [for i in [0..3] do yield stdin.ReadLine()|>int]
    |>fun c -> (min c.[0] c.[1])+(min c.[2] c.[3])
    |>stdout.WriteLine
    0
