a, b = map(int, input().split()) c, d = map(int, input().split()) a = -1 * a y = -1 * (d-b) / (c-a) * a + b print(y)