Олимпиадный тренинг

Задача 38314. Internet payment


Vitya is connected to the Internet according to the following tariff plan. The monthly subscription fee is A rubles, and this subscription fee includes B megabytes of traffic. Unused megabytes "burn out" at the end of the month. If the traffic exceeds B megabytes, then each megabyte of traffic in excess of prepaid costs C rubles.

It is known that last month Vitya spent D megabytes of traffic. How much did Internet access cost him last month (including the monthly fee)?

Input
Four natural numbers A, B, C, D are entered. All numbers do not exceed 100.

Imprint
Print one number — the amount (in rubles) that Vitya has to pay for the Internet.
Examples
# Input Output
1 100 10 12 15 160
2 100 10 12 1 100