N, K, X, Y = map(int, input().split()) A = sorted([(int(a) - 1 + K - 1) // K for a in input().split()]) s = 0 ans = 0 for i, a in enumerate(A): d = a - s if d > 0: if (N - i) * X < Y: ans += d * X else: ans += d * Y s += d print(ans)