import decimal a, b, x, y = map(decimal.Decimal, input().split()) c = a + b print((a + b) * min(x / a, y / b))