#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(int)(n); i++)

using namespace std;
using LL = long long;
using P = pair<int,int>;

int main(){
	LL N, K, X, Y;
	cin >> N >> K >> X >> Y;
	vector<LL> A(N);
	rep(i,N) cin >> A[i];
	rep(i,N) A[i]--;
	sort(A.begin(),A.end(),greater<LL>());
	LL n=Y/X, ans=0, t=0;
	if(n<N){
		t=(A[n]+K-1)/K;
		ans+=t*Y;
	}
	rep(i,min(n,N)) ans+=(A[i]-t*K+K-1)/K*X;
	cout << ans << endl;

	return 0;
}