from math import sqrt inputs = lambda:map(int, raw_input().split()) xa, ya = inputs() xb, yb = inputs() if ya > yb: xa, ya, xb, yb = xb, yb, xa, ya def calc(yp): return sqrt(xa**2+(ya-yp)**2) + sqrt(xb**2+(yb-yp)**2) left = ya; right = yb while 1: lm = (2*left+right)/3. rm = (left+2*right)/3. lc = calc(lm) rc = calc(rm) if lc < rc: if rm==right: break right = rm else: if lm==left: break left = lm print left