n,k,x,y = map(int, input().split()) a = list(map(int, input().split())) newa=[] def ceil(a,b): return ((a - 1) // b) + 1 for tmp in a: if tmp==1: continue newa.append(ceil(tmp-1,k)) newa.sort() all_cnt=0 single_cnt=0 nokori=len(newa) for num in newa: need = num - all_cnt if nokori*x >= y: all_cnt+=need nokori-=1 else: single_cnt+=need print(all_cnt*y + single_cnt*x)