
import java.util.Scanner;
import java.util.ArrayList;

public class Main {
	Scanner sc = new Scanner(System.in);
	int a, b, c, x, y;
	public void run(){
		a = sc.nextInt();
		b = sc.nextInt();
		c = sc.nextInt();
		x = sc.nextInt();
		y = sc.nextInt();
		solve();
	}
	
	int memo[][];
	
	public void solve(){
		int ans = 0;
		
		System.out.println(ret(x, y, 0));
		
	}
	
	public int ret(int xx, int yy, int sum){
		if(xx == 0 && yy == 0){
			return sum;
		}
		else if(xx == 0){
			if(b <= 2 * c){
				return ret(xx, 0, sum + b*yy);
			}
			else{
				return ret(xx, 0, sum + 2*c*yy);
			}
		}
		else if(yy == 0){
			if(a <= 2*c){
				return ret(0, yy, sum + a*xx);
			}
			else{
				return ret(0, yy, sum + 2*c*xx);
			}
		}
		else{
			int val = 0;
			if(a+b < 2*c){
				val = a+b;
			}
			else{
				val = 2*c;
			}
			
			if(xx < yy){
				return ret(0, yy - xx, sum + (val * xx));
			}
			else{
				return ret(xx-yy, 0, sum + (val * yy));
			}
		}
	}
	
	public static void main(String[] args){
		new Main().run();
	}
	
	static class Pair {
        int first,second;
        public Pair(int a,int b) {
            this.first = a;
            this.second = b;
        }
    }	
} import java.util.Scanner; Scanner java.util import java.util.ArrayList; ArrayList java.util public class Main {
	Scanner sc = new Scanner(System.in);
	int a, b, c, x, y;
	public void run(){
		a = sc.nextInt();
		b = sc.nextInt();
		c = sc.nextInt();
		x = sc.nextInt();
		y = sc.nextInt();
		solve();
	}
	
	int memo[][];
	
	public void solve(){
		int ans = 0;
		
		System.out.println(ret(x, y, 0));
		
	}
	
	public int ret(int xx, int yy, int sum){
		if(xx == 0 && yy == 0){
			return sum;
		}
		else if(xx == 0){
			if(b <= 2 * c){
				return ret(xx, 0, sum + b*yy);
			}
			else{
				return ret(xx, 0, sum + 2*c*yy);
			}
		}
		else if(yy == 0){
			if(a <= 2*c){
				return ret(0, yy, sum + a*xx);
			}
			else{
				return ret(0, yy, sum + 2*c*xx);
			}
		}
		else{
			int val = 0;
			if(a+b < 2*c){
				val = a+b;
			}
			else{
				val = 2*c;
			}
			
			if(xx < yy){
				return ret(0, yy - xx, sum + (val * xx));
			}
			else{
				return ret(xx-yy, 0, sum + (val * yy));
			}
		}
	}
	
	public static void main(String[] args){
		new Main().run();
	}
	
	static class Pair {
        int first,second;
        public Pair(int a,int b) {
            this.first = a;
            this.second = b;
        }
    }	
} Main Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a a b b c c x x y; y int memo[][]; memo public void run(){
		a = sc.nextInt();
		b = sc.nextInt();
		c = sc.nextInt();
		x = sc.nextInt();
		y = sc.nextInt();
		solve();
	} run {
		a = sc.nextInt();
		b = sc.nextInt();
		c = sc.nextInt();
		x = sc.nextInt();
		y = sc.nextInt();
		solve();
	} a = sc.nextInt() a sc.nextInt() sc.nextInt sc b = sc.nextInt() b sc.nextInt() sc.nextInt sc c = sc.nextInt() c sc.nextInt() sc.nextInt sc x = sc.nextInt() x sc.nextInt() sc.nextInt sc y = sc.nextInt() y sc.nextInt() sc.nextInt sc solve() solve public void solve(){
		int ans = 0;
		
		System.out.println(ret(x, y, 0));
		
	} solve {
		int ans = 0;
		
		System.out.println(ret(x, y, 0));
		
	} int ans = 0; ans 0 System.out.println(ret(x, y, 0)) System.out.println System.out System System.out ret(x, y, 0) ret x y 0 public int ret(int xx, int yy, int sum){
		if(xx == 0 && yy == 0){
			return sum;
		}
		else if(xx == 0){
			if(b <= 2 * c){
				return ret(xx, 0, sum + b*yy);
			}
			else{
				return ret(xx, 0, sum + 2*c*yy);
			}
		}
		else if(yy == 0){
			if(a <= 2*c){
				return ret(0, yy, sum + a*xx);
			}
			else{
				return ret(0, yy, sum + 2*c*xx);
			}
		}
		else{
			int val = 0;
			if(a+b < 2*c){
				val = a+b;
			}
			else{
				val = 2*c;
			}
			
			if(xx < yy){
				return ret(0, yy - xx, sum + (val * xx));
			}
			else{
				return ret(xx-yy, 0, sum + (val * yy));
			}
		}
	} ret {
		if(xx == 0 && yy == 0){
			return sum;
		}
		else if(xx == 0){
			if(b <= 2 * c){
				return ret(xx, 0, sum + b*yy);
			}
			else{
				return ret(xx, 0, sum + 2*c*yy);
			}
		}
		else if(yy == 0){
			if(a <= 2*c){
				return ret(0, yy, sum + a*xx);
			}
			else{
				return ret(0, yy, sum + 2*c*xx);
			}
		}
		else{
			int val = 0;
			if(a+b < 2*c){
				val = a+b;
			}
			else{
				val = 2*c;
			}
			
			if(xx < yy){
				return ret(0, yy - xx, sum + (val * xx));
			}
			else{
				return ret(xx-yy, 0, sum + (val * yy));
			}
		}
	} if(xx == 0 && yy == 0){
			return sum;
		}
		else if(xx == 0){
			if(b <= 2 * c){
				return ret(xx, 0, sum + b*yy);
			}
			else{
				return ret(xx, 0, sum + 2*c*yy);
			}
		}
		else if(yy == 0){
			if(a <= 2*c){
				return ret(0, yy, sum + a*xx);
			}
			else{
				return ret(0, yy, sum + 2*c*xx);
			}
		}
		else{
			int val = 0;
			if(a+b < 2*c){
				val = a+b;
			}
			else{
				val = 2*c;
			}
			
			if(xx < yy){
				return ret(0, yy - xx, sum + (val * xx));
			}
			else{
				return ret(xx-yy, 0, sum + (val * yy));
			}
		} xx == 0 && yy == 0 xx == 0 xx 0 yy == 0 yy 0 {
			return sum;
		} return sum; sum if(xx == 0){
			if(b <= 2 * c){
				return ret(xx, 0, sum + b*yy);
			}
			else{
				return ret(xx, 0, sum + 2*c*yy);
			}
		}
		else if(yy == 0){
			if(a <= 2*c){
				return ret(0, yy, sum + a*xx);
			}
			else{
				return ret(0, yy, sum + 2*c*xx);
			}
		}
		else{
			int val = 0;
			if(a+b < 2*c){
				val = a+b;
			}
			else{
				val = 2*c;
			}
			
			if(xx < yy){
				return ret(0, yy - xx, sum + (val * xx));
			}
			else{
				return ret(xx-yy, 0, sum + (val * yy));
			}
		} xx == 0 xx 0 {
			if(b <= 2 * c){
				return ret(xx, 0, sum + b*yy);
			}
			else{
				return ret(xx, 0, sum + 2*c*yy);
			}
		} if(b <= 2 * c){
				return ret(xx, 0, sum + b*yy);
			}
			else{
				return ret(xx, 0, sum + 2*c*yy);
			} b <= 2 * c b 2 * c 2 c {
				return ret(xx, 0, sum + b*yy);
			} return ret(xx, 0, sum + b*yy); ret(xx, 0, sum + b*yy) ret xx 0 sum + b*yy sum b*yy b yy {
				return ret(xx, 0, sum + 2*c*yy);
			} return ret(xx, 0, sum + 2*c*yy); ret(xx, 0, sum + 2*c*yy) ret xx 0 sum + 2*c*yy sum 2*c*yy 2*c*yy 2 c yy if(yy == 0){
			if(a <= 2*c){
				return ret(0, yy, sum + a*xx);
			}
			else{
				return ret(0, yy, sum + 2*c*xx);
			}
		}
		else{
			int val = 0;
			if(a+b < 2*c){
				val = a+b;
			}
			else{
				val = 2*c;
			}
			
			if(xx < yy){
				return ret(0, yy - xx, sum + (val * xx));
			}
			else{
				return ret(xx-yy, 0, sum + (val * yy));
			}
		} yy == 0 yy 0 {
			if(a <= 2*c){
				return ret(0, yy, sum + a*xx);
			}
			else{
				return ret(0, yy, sum + 2*c*xx);
			}
		} if(a <= 2*c){
				return ret(0, yy, sum + a*xx);
			}
			else{
				return ret(0, yy, sum + 2*c*xx);
			} a <= 2*c a 2*c 2 c {
				return ret(0, yy, sum + a*xx);
			} return ret(0, yy, sum + a*xx); ret(0, yy, sum + a*xx) ret 0 yy sum + a*xx sum a*xx a xx {
				return ret(0, yy, sum + 2*c*xx);
			} return ret(0, yy, sum + 2*c*xx); ret(0, yy, sum + 2*c*xx) ret 0 yy sum + 2*c*xx sum 2*c*xx 2*c*xx 2 c xx {
			int val = 0;
			if(a+b < 2*c){
				val = a+b;
			}
			else{
				val = 2*c;
			}
			
			if(xx < yy){
				return ret(0, yy - xx, sum + (val * xx));
			}
			else{
				return ret(xx-yy, 0, sum + (val * yy));
			}
		} int val = 0; val 0 if(a+b < 2*c){
				val = a+b;
			}
			else{
				val = 2*c;
			} a+b < 2*c a+b a b 2*c 2 c {
				val = a+b;
			} val = a+b val a+b a b {
				val = 2*c;
			} val = 2*c val 2*c 2 c if(xx < yy){
				return ret(0, yy - xx, sum + (val * xx));
			}
			else{
				return ret(xx-yy, 0, sum + (val * yy));
			} xx < yy xx yy {
				return ret(0, yy - xx, sum + (val * xx));
			} return ret(0, yy - xx, sum + (val * xx)); ret(0, yy - xx, sum + (val * xx)) ret 0 yy - xx yy xx sum + (val * xx) sum (val * xx) val xx {
				return ret(xx-yy, 0, sum + (val * yy));
			} return ret(xx-yy, 0, sum + (val * yy)); ret(xx-yy, 0, sum + (val * yy)) ret xx-yy xx yy 0 sum + (val * yy) sum (val * yy) val yy int xx xx int yy yy int sum sum public static void main(String[] args){
		new Main().run();
	} main {
		new Main().run();
	} new Main().run() new Main().run new Main() String[] args args static class Pair {
        int first,second;
        public Pair(int a,int b) {
            this.first = a;
            this.second = b;
        }
    } Pair int first first second; second public Pair(int a,int b) {
            this.first = a;
            this.second = b;
        } Pair {
            this.first = a;
            this.second = b;
        } this.first = a this.first this this.first a this.second = b this.second this this.second b int a a int b b public class Main {
	Scanner sc = new Scanner(System.in);
	int a, b, c, x, y;
	public void run(){
		a = sc.nextInt();
		b = sc.nextInt();
		c = sc.nextInt();
		x = sc.nextInt();
		y = sc.nextInt();
		solve();
	}
	
	int memo[][];
	
	public void solve(){
		int ans = 0;
		
		System.out.println(ret(x, y, 0));
		
	}
	
	public int ret(int xx, int yy, int sum){
		if(xx == 0 && yy == 0){
			return sum;
		}
		else if(xx == 0){
			if(b <= 2 * c){
				return ret(xx, 0, sum + b*yy);
			}
			else{
				return ret(xx, 0, sum + 2*c*yy);
			}
		}
		else if(yy == 0){
			if(a <= 2*c){
				return ret(0, yy, sum + a*xx);
			}
			else{
				return ret(0, yy, sum + 2*c*xx);
			}
		}
		else{
			int val = 0;
			if(a+b < 2*c){
				val = a+b;
			}
			else{
				val = 2*c;
			}
			
			if(xx < yy){
				return ret(0, yy - xx, sum + (val * xx));
			}
			else{
				return ret(xx-yy, 0, sum + (val * yy));
			}
		}
	}
	
	public static void main(String[] args){
		new Main().run();
	}
	
	static class Pair {
        int first,second;
        public Pair(int a,int b) {
            this.first = a;
            this.second = b;
        }
    }	
} public class Main {
	Scanner sc = new Scanner(System.in);
	int a, b, c, x, y;
	public void run(){
		a = sc.nextInt();
		b = sc.nextInt();
		c = sc.nextInt();
		x = sc.nextInt();
		y = sc.nextInt();
		solve();
	}
	
	int memo[][];
	
	public void solve(){
		int ans = 0;
		
		System.out.println(ret(x, y, 0));
		
	}
	
	public int ret(int xx, int yy, int sum){
		if(xx == 0 && yy == 0){
			return sum;
		}
		else if(xx == 0){
			if(b <= 2 * c){
				return ret(xx, 0, sum + b*yy);
			}
			else{
				return ret(xx, 0, sum + 2*c*yy);
			}
		}
		else if(yy == 0){
			if(a <= 2*c){
				return ret(0, yy, sum + a*xx);
			}
			else{
				return ret(0, yy, sum + 2*c*xx);
			}
		}
		else{
			int val = 0;
			if(a+b < 2*c){
				val = a+b;
			}
			else{
				val = 2*c;
			}
			
			if(xx < yy){
				return ret(0, yy - xx, sum + (val * xx));
			}
			else{
				return ret(xx-yy, 0, sum + (val * yy));
			}
		}
	}
	
	public static void main(String[] args){
		new Main().run();
	}
	
	static class Pair {
        int first,second;
        public Pair(int a,int b) {
            this.first = a;
            this.second = b;
        }
    }	
} Main

import java.util.Scanner;
import java.util.ArrayList;

public class Main {
	Scanner sc = new Scanner(System.in);
	int a, b, c, x, y;
	public void run(){
		a = sc.nextInt();
		b = sc.nextInt();
		c = sc.nextInt();
		x = sc.nextInt();
		y = sc.nextInt();
		solve();
	}
	
	int memo[][];
	
	public void solve(){
		int ans = 0;
		
		System.out.println(ret(x, y, 0));
		
	}
	
	public int ret(int xx, int yy, int sum){
		if(xx == 0 && yy == 0){
			return sum;
		}
		else if(xx == 0){
			if(b <= 2 * c){
				return ret(xx, 0, sum + b*yy);
			}
			else{
				return ret(xx, 0, sum + 2*c*yy);
			}
		}
		else if(yy == 0){
			if(a <= 2*c){
				return ret(0, yy, sum + a*xx);
			}
			else{
				return ret(0, yy, sum + 2*c*xx);
			}
		}
		else{
			int val = 0;
			if(a+b < 2*c){
				val = a+b;
			}
			else{
				val = 2*c;
			}
			
			if(xx < yy){
				return ret(0, yy - xx, sum + (val * xx));
			}
			else{
				return ret(xx-yy, 0, sum + (val * yy));
			}
		}
	}
	
	public static void main(String[] args){
		new Main().run();
	}
	
	static class Pair {
        int first,second;
        public Pair(int a,int b) {
            this.first = a;
            this.second = b;
        }
    }	
}
