There is a hotel with the following accommodation fee:    * X yen (the currency of Japan) per night, for the first K nights   * Y yen per night, for the (K+1)-th and subsequent nights  Tak is staying at this hotel for N consecutive nights. Find his total accommodation fee.
a = [int(input()) for i in range(4)]
print(a[2]*a[0]+max(0,(a[0]-a[1])*a[3]))
n, k, x, y = [int(input()) for _ in range(4)]
print(x*min(n, k)+y*max(0, n-k))