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