# No.236 鴛鴦茶 a, b, x, y = [int(i) for i in input().split()] if a * y > b * x: print(x + x / a * b) else: print(y + y / b * a)