https://www.acmicpc.net/problem/10707
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner s=new Scanner(System.in);
int a=s.nextInt();
int b=s.nextInt();
int c=s.nextInt();
int d=s.nextInt();
int p=s.nextInt();
int sum=p*a;
int sum1=0;
if(p<=c) sum1=b;
else sum1=b+(p-c)*d;
System.out.print(Math.min(sum,sum1));
}
}