i=lambda:int(eval(input()));print((min(i(),i())+min(i(),i())))
s='int(input())';print((eval(('+min(%s,%s)'%(s,s))*2)))
i = lambda: int(eval(input()))
print((min(i(), i()) + min(i(), i())))

s = "int(input())"
print((eval(("+min(%s,%s)" % (s, s)) * 2)))

-i = lambda: int(eval(input())) -print((min(i(), i()) + min(i(), i()))) +s = "int(input())" +print((eval(("+min(%s,%s)" % (s, s)) * 2)))