A, B, X, Y = map(int, raw_input().split()) if A * Y > B * X: ans = X + X / float(A) * B else: ans = Y + Y / float(B) * A print ans