import java.util.*; import java.util.stream.*; class Main { static Scanner s=new Scanner(System.in); static int gInt(){return Integer.parseInt(s.next());} public static void main(String[]$){ int a=gInt(),b=gInt(); System.out.println((a+b)*Math.min(s.nextDouble()/a,s.nextDouble()/b)); } }