a,b,o,w = map(int,input().split())
print(max(a,b)+o+w)