a, b, o, w = (int(s) for s in input().split()) print(o + max(a, b) + w)