#coding: utf-8 #yuki_306 import sys s1=map(int,raw_input().split()) s2=map(int,raw_input().split()) xa=s1[0] ya=s1[1] xb=s2[0] yb=s2[1] if xa==xb: res=1.0*(yb+ya)/2 print "%.7f" % res elif ya==yb: print ya sys.exit() else: xa=-xa res=(1.0*ya-1.0*(yb-ya)/(xb-xa)*xa) print "%.7f" % res