#306saitama xa,ya=(int(i) for i in input().split()) xb,yb=(int(i) for i in input().split()) xb*=-1 xa-=xb ya-=yb a=ya/xa a*=xa ya+=a print(ya)