import math px, py = (abs(int(i)) for i in input().split()) qx, qy = (abs(int(i)) for i in input().split()) print((px + py + qx + qy) / 2)