import java.util.Scanner;

public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			int A = scan.nextInt();
			int B = scan.nextInt();
			int C = scan.nextInt();
			int X = scan.nextInt();
			int Y = scan.nextInt();
			
			int m = Math.min(A, B);
			int l = Math.max(A, B);
			
			int minx = 0;
			int miny = 0;
			int minz = 0;
			
			int saisyou = 2*C*Math.max(X, Y);
			
			for(int i =0;i<=Math.min(X, Y);i++) {
				
				int ne = A*(X-i)+B*(Y-i)+2*C*i;
				//System.out.println(ne);
				if(saisyou>ne) {
					saisyou=ne;
					minx  = (X-i);
					miny  = (Y-i);
					minz = 2*i;
					
				}
				
			}
			
			
			
			System.out.println(saisyou);
			//System.out.println(minx);
			//System.out.println(miny);
			//System.out.println(minz);
			
			
		}	
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			int A = scan.nextInt();
			int B = scan.nextInt();
			int C = scan.nextInt();
			int X = scan.nextInt();
			int Y = scan.nextInt();
			
			int m = Math.min(A, B);
			int l = Math.max(A, B);
			
			int minx = 0;
			int miny = 0;
			int minz = 0;
			
			int saisyou = 2*C*Math.max(X, Y);
			
			for(int i =0;i<=Math.min(X, Y);i++) {
				
				int ne = A*(X-i)+B*(Y-i)+2*C*i;
				//System.out.println(ne);
				if(saisyou>ne) {
					saisyou=ne;
					minx  = (X-i);
					miny  = (Y-i);
					minz = 2*i;
					
				}
				
			}
			
			
			
			System.out.println(saisyou);
			//System.out.println(minx);
			//System.out.println(miny);
			//System.out.println(minz);
			
			
		}	
	}
} Main public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			int A = scan.nextInt();
			int B = scan.nextInt();
			int C = scan.nextInt();
			int X = scan.nextInt();
			int Y = scan.nextInt();
			
			int m = Math.min(A, B);
			int l = Math.max(A, B);
			
			int minx = 0;
			int miny = 0;
			int minz = 0;
			
			int saisyou = 2*C*Math.max(X, Y);
			
			for(int i =0;i<=Math.min(X, Y);i++) {
				
				int ne = A*(X-i)+B*(Y-i)+2*C*i;
				//System.out.println(ne);
				if(saisyou>ne) {
					saisyou=ne;
					minx  = (X-i);
					miny  = (Y-i);
					minz = 2*i;
					
				}
				
			}
			
			
			
			System.out.println(saisyou);
			//System.out.println(minx);
			//System.out.println(miny);
			//System.out.println(minz);
			
			
		}	
	} main {
		try(Scanner scan = new Scanner(System.in)){
			
			int A = scan.nextInt();
			int B = scan.nextInt();
			int C = scan.nextInt();
			int X = scan.nextInt();
			int Y = scan.nextInt();
			
			int m = Math.min(A, B);
			int l = Math.max(A, B);
			
			int minx = 0;
			int miny = 0;
			int minz = 0;
			
			int saisyou = 2*C*Math.max(X, Y);
			
			for(int i =0;i<=Math.min(X, Y);i++) {
				
				int ne = A*(X-i)+B*(Y-i)+2*C*i;
				//System.out.println(ne);
				if(saisyou>ne) {
					saisyou=ne;
					minx  = (X-i);
					miny  = (Y-i);
					minz = 2*i;
					
				}
				
			}
			
			
			
			System.out.println(saisyou);
			//System.out.println(minx);
			//System.out.println(miny);
			//System.out.println(minz);
			
			
		}	
	} try(Scanner scan = new Scanner(System.in)){
			
			int A = scan.nextInt();
			int B = scan.nextInt();
			int C = scan.nextInt();
			int X = scan.nextInt();
			int Y = scan.nextInt();
			
			int m = Math.min(A, B);
			int l = Math.max(A, B);
			
			int minx = 0;
			int miny = 0;
			int minz = 0;
			
			int saisyou = 2*C*Math.max(X, Y);
			
			for(int i =0;i<=Math.min(X, Y);i++) {
				
				int ne = A*(X-i)+B*(Y-i)+2*C*i;
				//System.out.println(ne);
				if(saisyou>ne) {
					saisyou=ne;
					minx  = (X-i);
					miny  = (Y-i);
					minz = 2*i;
					
				}
				
			}
			
			
			
			System.out.println(saisyou);
			//System.out.println(minx);
			//System.out.println(miny);
			//System.out.println(minz);
			
			
		} {
			
			int A = scan.nextInt();
			int B = scan.nextInt();
			int C = scan.nextInt();
			int X = scan.nextInt();
			int Y = scan.nextInt();
			
			int m = Math.min(A, B);
			int l = Math.max(A, B);
			
			int minx = 0;
			int miny = 0;
			int minz = 0;
			
			int saisyou = 2*C*Math.max(X, Y);
			
			for(int i =0;i<=Math.min(X, Y);i++) {
				
				int ne = A*(X-i)+B*(Y-i)+2*C*i;
				//System.out.println(ne);
				if(saisyou>ne) {
					saisyou=ne;
					minx  = (X-i);
					miny  = (Y-i);
					minz = 2*i;
					
				}
				
			}
			
			
			
			System.out.println(saisyou);
			//System.out.println(minx);
			//System.out.println(miny);
			//System.out.println(minz);
			
			
		} Scanner scan = new Scanner(System.in) Scanner scan = new Scanner(System.in) new Scanner(System.in) int A = scan.nextInt(); A scan.nextInt() scan.nextInt scan int B = scan.nextInt(); B scan.nextInt() scan.nextInt scan int C = scan.nextInt(); C scan.nextInt() scan.nextInt scan int X = scan.nextInt(); X scan.nextInt() scan.nextInt scan int Y = scan.nextInt(); Y scan.nextInt() scan.nextInt scan int m = Math.min(A, B); m Math.min(A, B) Math.min Math A B int l = Math.max(A, B); l Math.max(A, B) Math.max Math A B int minx = 0; minx 0 int miny = 0; miny 0 int minz = 0; minz 0 int saisyou = 2*C*Math.max(X, Y); saisyou 2*C*Math.max(X, Y) 2*C*Math.max(X, Y) 2 C Math.max(X, Y) Math.max Math X Y for(int i =0;i<=Math.min(X, Y);i++) {
				
				int ne = A*(X-i)+B*(Y-i)+2*C*i;
				//System.out.println(ne);
				if(saisyou>ne) {
					saisyou=ne;
					minx  = (X-i);
					miny  = (Y-i);
					minz = 2*i;
					
				}
				
			} int i =0; int i =0; i 0 i<=Math.min(X, Y) i Math.min(X, Y) Math.min Math X Y i++ i++ i {
				
				int ne = A*(X-i)+B*(Y-i)+2*C*i;
				//System.out.println(ne);
				if(saisyou>ne) {
					saisyou=ne;
					minx  = (X-i);
					miny  = (Y-i);
					minz = 2*i;
					
				}
				
			} {
				
				int ne = A*(X-i)+B*(Y-i)+2*C*i;
				//System.out.println(ne);
				if(saisyou>ne) {
					saisyou=ne;
					minx  = (X-i);
					miny  = (Y-i);
					minz = 2*i;
					
				}
				
			} int ne = A*(X-i)+B*(Y-i)+2*C*i; ne A*(X-i)+B*(Y-i)+2*C*i A*(X-i)+B*(Y-i)+2*C*i A*(X-i) A (X-i) X i B*(Y-i) B (Y-i) Y i 2*C*i 2*C*i 2 C i if(saisyou>ne) {
					saisyou=ne;
					minx  = (X-i);
					miny  = (Y-i);
					minz = 2*i;
					
				} saisyou>ne saisyou ne {
					saisyou=ne;
					minx  = (X-i);
					miny  = (Y-i);
					minz = 2*i;
					
				} saisyou=ne saisyou ne minx  = (X-i) minx (X-i) X i miny  = (Y-i) miny (Y-i) Y i minz = 2*i minz 2*i 2 i System.out.println(saisyou) System.out.println System.out System System.out saisyou String[]args args public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			int A = scan.nextInt();
			int B = scan.nextInt();
			int C = scan.nextInt();
			int X = scan.nextInt();
			int Y = scan.nextInt();
			
			int m = Math.min(A, B);
			int l = Math.max(A, B);
			
			int minx = 0;
			int miny = 0;
			int minz = 0;
			
			int saisyou = 2*C*Math.max(X, Y);
			
			for(int i =0;i<=Math.min(X, Y);i++) {
				
				int ne = A*(X-i)+B*(Y-i)+2*C*i;
				//System.out.println(ne);
				if(saisyou>ne) {
					saisyou=ne;
					minx  = (X-i);
					miny  = (Y-i);
					minz = 2*i;
					
				}
				
			}
			
			
			
			System.out.println(saisyou);
			//System.out.println(minx);
			//System.out.println(miny);
			//System.out.println(minz);
			
			
		}	
	}
} public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			int A = scan.nextInt();
			int B = scan.nextInt();
			int C = scan.nextInt();
			int X = scan.nextInt();
			int Y = scan.nextInt();
			
			int m = Math.min(A, B);
			int l = Math.max(A, B);
			
			int minx = 0;
			int miny = 0;
			int minz = 0;
			
			int saisyou = 2*C*Math.max(X, Y);
			
			for(int i =0;i<=Math.min(X, Y);i++) {
				
				int ne = A*(X-i)+B*(Y-i)+2*C*i;
				//System.out.println(ne);
				if(saisyou>ne) {
					saisyou=ne;
					minx  = (X-i);
					miny  = (Y-i);
					minz = 2*i;
					
				}
				
			}
			
			
			
			System.out.println(saisyou);
			//System.out.println(minx);
			//System.out.println(miny);
			//System.out.println(minz);
			
			
		}	
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			int A = scan.nextInt();
			int B = scan.nextInt();
			int C = scan.nextInt();
			int X = scan.nextInt();
			int Y = scan.nextInt();
			
			int m = Math.min(A, B);
			int l = Math.max(A, B);
			
			int minx = 0;
			int miny = 0;
			int minz = 0;
			
			int saisyou = 2*C*Math.max(X, Y);
			
			for(int i =0;i<=Math.min(X, Y);i++) {
				
				int ne = A*(X-i)+B*(Y-i)+2*C*i;
				//System.out.println(ne);
				if(saisyou>ne) {
					saisyou=ne;
					minx  = (X-i);
					miny  = (Y-i);
					minz = 2*i;
					
				}
				
			}
			
			
			
			System.out.println(saisyou);
			//System.out.println(minx);
			//System.out.println(miny);
			//System.out.println(minz);
			
			
		}	
	}
}
