A,B,X,Y = map(int,raw_input().split()) a = X * 1.0 / A b = Y * 1.0 / B minValue = min(a,b) print ((A * minValue) + (B * minValue))