local a = io.read()
local b = io.read()
local c = io.read()
local d = io.read()

local aa = 0 
local bb = 0 

if a < b then
    aa = tonumber(a)
elseif a == b then
    aa = tonumber(a)
else
    aa = tonumber(b)
end

if c < d then
    bb = tonumber(c)
elseif c == d then
    bb = tonumber(c)
else
    bb = tonumber(d)
end

print(aa+bb)