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