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