A, B, X, Y = map(int, input().split()) ans = min((A+B)/A*X, (A+B)/B*Y) print(ans)