import java.util.Scanner; class no236{ public static void main(String[] args) { Scanner stdIn=new Scanner(System.in); double a=stdIn.nextDouble(),b=stdIn.nextDouble(),x=stdIn.nextDouble(),y=stdIn.nextDouble(); System.out.print(x/a*b<=y?x+x*b/a:y+y*a/b); } }