import java.util.Scanner; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); double a = in.nextDouble(); double b = in.nextDouble(); double x = in.nextDouble(); double y = in.nextDouble(); System.out.println((a + b) * (Math.min((x/a), (y/b)))); in.close(); } }