A, B, O, W = map(int, input().split()) print(max(A, B) + O + W)