import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int e = sc.nextInt();
		int mai;
		int nokori;
		if(d>=e) {
			mai = e;
			nokori = d-e;
		}else {
			mai = d;
			nokori = e-d;
		}

		int money = 0;

		if(a+b > 2*c) {
			money = 2*c*mai;
			if(d>=e) {
				money += nokori * a;
			}else {
				money += nokori*b;
			}
		}else{
			money += a*d;
			money += b*e;
		}

		int yokei;
		if(d>=e) {
			yokei = 2*c*d;
		}else {
			yokei = 2*c*e;
		}

		int kingaku = 0;
		if(yokei>=money) {
			kingaku = money;
		}else {
			kingaku = yokei;
		}


		System.out.println(kingaku);
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int e = sc.nextInt();
		int mai;
		int nokori;
		if(d>=e) {
			mai = e;
			nokori = d-e;
		}else {
			mai = d;
			nokori = e-d;
		}

		int money = 0;

		if(a+b > 2*c) {
			money = 2*c*mai;
			if(d>=e) {
				money += nokori * a;
			}else {
				money += nokori*b;
			}
		}else{
			money += a*d;
			money += b*e;
		}

		int yokei;
		if(d>=e) {
			yokei = 2*c*d;
		}else {
			yokei = 2*c*e;
		}

		int kingaku = 0;
		if(yokei>=money) {
			kingaku = money;
		}else {
			kingaku = yokei;
		}


		System.out.println(kingaku);
	}

} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int e = sc.nextInt();
		int mai;
		int nokori;
		if(d>=e) {
			mai = e;
			nokori = d-e;
		}else {
			mai = d;
			nokori = e-d;
		}

		int money = 0;

		if(a+b > 2*c) {
			money = 2*c*mai;
			if(d>=e) {
				money += nokori * a;
			}else {
				money += nokori*b;
			}
		}else{
			money += a*d;
			money += b*e;
		}

		int yokei;
		if(d>=e) {
			yokei = 2*c*d;
		}else {
			yokei = 2*c*e;
		}

		int kingaku = 0;
		if(yokei>=money) {
			kingaku = money;
		}else {
			kingaku = yokei;
		}


		System.out.println(kingaku);
	} main {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int e = sc.nextInt();
		int mai;
		int nokori;
		if(d>=e) {
			mai = e;
			nokori = d-e;
		}else {
			mai = d;
			nokori = e-d;
		}

		int money = 0;

		if(a+b > 2*c) {
			money = 2*c*mai;
			if(d>=e) {
				money += nokori * a;
			}else {
				money += nokori*b;
			}
		}else{
			money += a*d;
			money += b*e;
		}

		int yokei;
		if(d>=e) {
			yokei = 2*c*d;
		}else {
			yokei = 2*c*e;
		}

		int kingaku = 0;
		if(yokei>=money) {
			kingaku = money;
		}else {
			kingaku = yokei;
		}


		System.out.println(kingaku);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int c = sc.nextInt(); c sc.nextInt() sc.nextInt sc int d = sc.nextInt(); d sc.nextInt() sc.nextInt sc int e = sc.nextInt(); e sc.nextInt() sc.nextInt sc int mai; mai int nokori; nokori if(d>=e) {
			mai = e;
			nokori = d-e;
		}else {
			mai = d;
			nokori = e-d;
		} d>=e d e {
			mai = e;
			nokori = d-e;
		} mai = e mai e nokori = d-e nokori d-e d e {
			mai = d;
			nokori = e-d;
		} mai = d mai d nokori = e-d nokori e-d e d int money = 0; money 0 if(a+b > 2*c) {
			money = 2*c*mai;
			if(d>=e) {
				money += nokori * a;
			}else {
				money += nokori*b;
			}
		}else{
			money += a*d;
			money += b*e;
		} a+b > 2*c a+b a b 2*c 2 c {
			money = 2*c*mai;
			if(d>=e) {
				money += nokori * a;
			}else {
				money += nokori*b;
			}
		} money = 2*c*mai money 2*c*mai 2*c*mai 2 c mai if(d>=e) {
				money += nokori * a;
			}else {
				money += nokori*b;
			} d>=e d e {
				money += nokori * a;
			} money += nokori * a money nokori * a nokori a {
				money += nokori*b;
			} money += nokori*b money nokori*b nokori b {
			money += a*d;
			money += b*e;
		} money += a*d money a*d a d money += b*e money b*e b e int yokei; yokei if(d>=e) {
			yokei = 2*c*d;
		}else {
			yokei = 2*c*e;
		} d>=e d e {
			yokei = 2*c*d;
		} yokei = 2*c*d yokei 2*c*d 2*c*d 2 c d {
			yokei = 2*c*e;
		} yokei = 2*c*e yokei 2*c*e 2*c*e 2 c e int kingaku = 0; kingaku 0 if(yokei>=money) {
			kingaku = money;
		}else {
			kingaku = yokei;
		} yokei>=money yokei money {
			kingaku = money;
		} kingaku = money kingaku money {
			kingaku = yokei;
		} kingaku = yokei kingaku yokei System.out.println(kingaku) System.out.println System.out System System.out kingaku String[] args args public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int e = sc.nextInt();
		int mai;
		int nokori;
		if(d>=e) {
			mai = e;
			nokori = d-e;
		}else {
			mai = d;
			nokori = e-d;
		}

		int money = 0;

		if(a+b > 2*c) {
			money = 2*c*mai;
			if(d>=e) {
				money += nokori * a;
			}else {
				money += nokori*b;
			}
		}else{
			money += a*d;
			money += b*e;
		}

		int yokei;
		if(d>=e) {
			yokei = 2*c*d;
		}else {
			yokei = 2*c*e;
		}

		int kingaku = 0;
		if(yokei>=money) {
			kingaku = money;
		}else {
			kingaku = yokei;
		}


		System.out.println(kingaku);
	}

} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int e = sc.nextInt();
		int mai;
		int nokori;
		if(d>=e) {
			mai = e;
			nokori = d-e;
		}else {
			mai = d;
			nokori = e-d;
		}

		int money = 0;

		if(a+b > 2*c) {
			money = 2*c*mai;
			if(d>=e) {
				money += nokori * a;
			}else {
				money += nokori*b;
			}
		}else{
			money += a*d;
			money += b*e;
		}

		int yokei;
		if(d>=e) {
			yokei = 2*c*d;
		}else {
			yokei = 2*c*e;
		}

		int kingaku = 0;
		if(yokei>=money) {
			kingaku = money;
		}else {
			kingaku = yokei;
		}


		System.out.println(kingaku);
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int e = sc.nextInt();
		int mai;
		int nokori;
		if(d>=e) {
			mai = e;
			nokori = d-e;
		}else {
			mai = d;
			nokori = e-d;
		}

		int money = 0;

		if(a+b > 2*c) {
			money = 2*c*mai;
			if(d>=e) {
				money += nokori * a;
			}else {
				money += nokori*b;
			}
		}else{
			money += a*d;
			money += b*e;
		}

		int yokei;
		if(d>=e) {
			yokei = 2*c*d;
		}else {
			yokei = 2*c*e;
		}

		int kingaku = 0;
		if(yokei>=money) {
			kingaku = money;
		}else {
			kingaku = yokei;
		}


		System.out.println(kingaku);
	}

}