#include "iostream" using namespace std; int main(){ double a,b,x,y; cin >> a >> b >> x >> y; printf("%.6f\n",(a+b) * min(x/a,y/b)); return 0; }