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