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