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