from math import floor,ceil N,K,X,Y=map(int,input().split()) A=list(map(int,input().split())) D=set() B=[] for i in range(N): x=ceil((A[i]-1)/K) B.append(x) B.sort() T=min(floor(Y/X),N) if T==N: print(sum(B)*X) else: P=B[N-1-T] S=P*Y for b in B: S+=max(0,b-P)*X print(S)