[A,B,X,Y] = map(float,raw_input().split()) print min(X/A,Y/B)*(A+B)