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