import java.util.*; import java.io.*; import java.awt.geom.*; import java.math.*; public class No0236 { static final Scanner in = new Scanner(System.in); static final PrintWriter out = new PrintWriter(System.out,false); static void solve() { double a = in.nextInt(); double b = in.nextInt(); int x = in.nextInt(); int y = in.nextInt(); out.printf("%.10f\n",(a+b)*Math.min(x/a,y/b)); } public static void main(String[] args) { long start = System.currentTimeMillis(); solve(); out.flush(); long end = System.currentTimeMillis(); //trace(end-start + "ms"); in.close(); out.close(); } static void trace(Object... o) { System.out.println(Arrays.deepToString(o));} }