import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import static java.lang.System.in; public class No236 { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(in)); String[] inputs = reader.readLine().split(" "); int A = Integer.parseInt(inputs[0]); int B = Integer.parseInt(inputs[1]); int X = Integer.parseInt(inputs[2]); int Y = Integer.parseInt(inputs[3]); System.out.println((A + B) * (float) Math.min(X / ((double) A), Y / ((double) B))); } }