import math N, K, X, Y = map(int,input().split()) A = list(map(int,input().split())) A.sort() C = [] for i in range(N): C.append(math.ceil((A[i]-1)/ K)) cnt = math.ceil(Y / X)#ベホマラーのほうが良い人数 if cnt >= N: print(sum(C) * X) exit() else: B = C[-cnt] #print("A = ",A) #print("cnt = ", cnt) #print("B = ",B) #print("C = ",C) #print(C[-cnt:]) ans = 0 ans += B * Y tmp = sum(C[-cnt:]) - B *cnt ans += tmp * X print(ans)