Water Bill

No attempts yetTime limit1sMemory limit256 MB

Problem

The area where JOI lives has two water companies, company X and company Y. Each company sets the monthly bill from the amount of water used.

  • Company X: AA yen per liter.
  • Company Y: the base fee is BB yen. If the usage is at most CC liters, only the base fee is charged. If the usage is more than CC liters, an extra fee is added to the base fee of BB yen: DD yen for each liter above CC.

JOI's house uses PP liters of water in a month.

JOI picks the company that makes the bill as cheap as possible. Find the monthly water bill of JOI's house.

Input

The input has 5 lines, one integer per line.

  • The first line has AA, the per-liter charge of company X.
  • The second line has BB, the base fee of company Y.
  • The third line has CC, the usage limit up to which company Y charges only the base fee.
  • The fourth line has DD, the per-liter extra fee of company Y.
  • The fifth line has PP, the amount of water JOI's house uses in a month.

AA, BB, CC, DD, and PP are integers between 1 and 10000, inclusive.

Output

Print the monthly water bill of JOI's house on the first line.

Hint

In the first example the usage is 10 liters.

  • The bill of company X is 9×10=909 \times 10 = 90 yen.
  • The usage is at most 20 liters, so the bill of company Y is the base fee, 100 yen.

Company X is cheaper, so the answer is 90 yen.

In the second example the usage is 250 liters.

  • The bill of company X is 8×250=20008 \times 250 = 2000 yen.
  • The usage is above 100 liters, so the excess is 250100=150250 - 100 = 150 liters. The bill of company Y is the base fee of 300 yen plus an extra fee of 10×150=150010 \times 150 = 1500 yen, which is 300+1500=1800300 + 1500 = 1800 yen.

Company Y is cheaper, so the answer is 1800 yen.