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