https://www.acmicpc.net/problem/10707
a=int(input()) b=int(input()) c=int(input()) d=int(input()) p=int(input()) sum=p*a sum1=0 if p<=c: sum1=b else: sum1=b+(p-c)*d print(min(sum,sum1))