import java.util.*; import static java.lang.System.*; import java.math.*; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { BigDecimal a = BigDecimal.valueOf(sc.nextInt()); BigDecimal b = BigDecimal.valueOf(sc.nextInt()); BigDecimal base = a.add(b); BigDecimal x = BigDecimal.valueOf(sc.nextInt()); BigDecimal y = BigDecimal.valueOf(sc.nextInt()); BigDecimal x_rate = x.divide(a,8,RoundingMode.HALF_UP); BigDecimal y_rate = y.divide(b,8,RoundingMode.HALF_UP); if (x_rate.compareTo(y_rate) <= 0) {out.println(base.multiply(x_rate));} else {out.println(base.multiply(y_rate));} } }