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