A family consists of x members. You are given the task to book flight tickets for these x members.
You are given the following information about the airline in which you have to book the tickets:
Determine the total cost to book the tickets for all the family members.
Note: The tickets are booked one by one for all the family members.
Input format
First line: Five space-separated integers P,S,T,H, and x respectively
Output format
Print the total cost to book the tickets for all the members of the family.
Constraints
1≤P≤H≤105
1≤S≤300
1≤T≤S
1≤x≤S
Monk books 5 tickets for price 6000 each and rest 2 for price 6500 each.
Total expenditure = 6000*5+6500*2 = 43000