n,k,x,y=map(int,input().split()) a=sorted([*map(lambda x:(int(x)-1)//k if (int(x)-1)%k==0 else (int(x)-1)//k+1,input().split())]) ans=0 b=n while b>0: m=a[n-b] ans+=y*m if y