N, K, X, Y = map(int, input().split()) A = list(map(lambda x: int(x) - 1, input().split())) A.sort() n = Y // X if n < N: x = (A[N - n - 1] - 1) // K + 1 ans = x * Y for i in range(N - n, N): ans += ((A[i] - 1) // K + 1 - x) * X print(ans) else: print(sum([((a - 1) // K + 1) * x for a in A]))