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