xa, ya = map(int, input().split()) xb, yb = map(int, input().split()) xa *= -1 ans = yb + (xb*(ya - yb)/(xb - xa)) print(ans)