import java.util.Scanner; public class yukicoder_236 { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); int a = stdIn.nextInt(); int b = stdIn.nextInt(); int x = stdIn.nextInt(); int y = stdIn.nextInt(); double ax = (double)x / a; double by = (double)y / b; if (ax >= by) { System.out.println((a + b) * by); } else { System.out.println((a + b) * ax); } } }