import sys input = sys.stdin.readline A, B, O, W = map(int, input().split()) ans = O+max(A, B)+W print(ans)