include Math
line = gets
x_price_per_liter = line.to_i

line = gets
y_basic_price = line.to_i

line = gets
y_basic_limit = line.to_i

line = gets
y_external_price_per_liter = line.to_i

line = gets
joi_used_amout = line.to_i

x_price = joi_used_amout * x_price_per_liter

y_price = 0
if joi_used_amout > y_basic_limit
  external_liter = joi_used_amout - y_basic_limit
  y_price = y_basic_price + external_liter * y_external_price_per_liter
else
  y_price = y_basic_price
end
if x_price < y_price
  puts x_price
else
  puts y_price
end