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