a, b, x, y = map(int, input().split()) if x * (b / a) <= y: print(x / a * (a + b)) else: print(y / b * (a + b))