import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int A = sc.nextInt(); int B = sc.nextInt(); int X = sc.nextInt(); int Y = sc.nextInt(); double c = (double)X/A; double d = (double)Y/B; double e = Math.min(c,d); double r = e*(A+B); System.out.println(r); } }