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 ans; if (x * b <= y * a) { ans = (double)x / a * b + x; } else { ans = (double)y / b * a + y; } System.out.println(ans); } }