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