import bisect import sys input=sys.stdin.readline def main(args): N, K, X, Y = map(int,input().split()) A = list(map(lambda x:-(-(int(x)-1)//K), input().split())) A.sort() ans = float('inf') l = 0 behomara = 0 while True: if behomara >= A[l]: l = bisect.bisect_right(A,behomara) #回復したい人数 res = N - l if Y < res*X: behomara += 1 else: behoimi = sum(map(lambda x:x-behomara,A[l:])) break if res == 0: break print(X*behoimi+Y*behomara) if __name__ == '__main__': main(sys.argv[1:])