import java.util.*;

public class Main {
	public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		long A = keyboard.nextLong();
		long B = keyboard.nextLong();
		long C = keyboard.nextLong();
		long X = keyboard.nextLong();
		long Y = keyboard.nextLong();
		
		long Large = X >= Y ? X : Y;
		long small = X <= Y ? X : Y; 
		
		long sum = 0;
		long nokori = Large - small;
		
		if(A+B > 2*C) {
			sum = small*(2*C);
			
			if(Large == X) {
				if(A < 2*C) {
					sum += nokori*A;
				}else {
					sum += nokori*2*C;
				}
			}else{
				if(B < 2*C) {
					sum += nokori*B;
				}else {
					sum += nokori*2*C;
				}
			}
			
		}else {
			sum = A*X + B*Y;
		}
		
		System.out.print(sum);
		keyboard.close();
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		long A = keyboard.nextLong();
		long B = keyboard.nextLong();
		long C = keyboard.nextLong();
		long X = keyboard.nextLong();
		long Y = keyboard.nextLong();
		
		long Large = X >= Y ? X : Y;
		long small = X <= Y ? X : Y; 
		
		long sum = 0;
		long nokori = Large - small;
		
		if(A+B > 2*C) {
			sum = small*(2*C);
			
			if(Large == X) {
				if(A < 2*C) {
					sum += nokori*A;
				}else {
					sum += nokori*2*C;
				}
			}else{
				if(B < 2*C) {
					sum += nokori*B;
				}else {
					sum += nokori*2*C;
				}
			}
			
		}else {
			sum = A*X + B*Y;
		}
		
		System.out.print(sum);
		keyboard.close();
	}
} Main public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		long A = keyboard.nextLong();
		long B = keyboard.nextLong();
		long C = keyboard.nextLong();
		long X = keyboard.nextLong();
		long Y = keyboard.nextLong();
		
		long Large = X >= Y ? X : Y;
		long small = X <= Y ? X : Y; 
		
		long sum = 0;
		long nokori = Large - small;
		
		if(A+B > 2*C) {
			sum = small*(2*C);
			
			if(Large == X) {
				if(A < 2*C) {
					sum += nokori*A;
				}else {
					sum += nokori*2*C;
				}
			}else{
				if(B < 2*C) {
					sum += nokori*B;
				}else {
					sum += nokori*2*C;
				}
			}
			
		}else {
			sum = A*X + B*Y;
		}
		
		System.out.print(sum);
		keyboard.close();
	} main {
		
		Scanner keyboard = new Scanner(System.in); 
		
		long A = keyboard.nextLong();
		long B = keyboard.nextLong();
		long C = keyboard.nextLong();
		long X = keyboard.nextLong();
		long Y = keyboard.nextLong();
		
		long Large = X >= Y ? X : Y;
		long small = X <= Y ? X : Y; 
		
		long sum = 0;
		long nokori = Large - small;
		
		if(A+B > 2*C) {
			sum = small*(2*C);
			
			if(Large == X) {
				if(A < 2*C) {
					sum += nokori*A;
				}else {
					sum += nokori*2*C;
				}
			}else{
				if(B < 2*C) {
					sum += nokori*B;
				}else {
					sum += nokori*2*C;
				}
			}
			
		}else {
			sum = A*X + B*Y;
		}
		
		System.out.print(sum);
		keyboard.close();
	} Scanner keyboard = new Scanner(System.in); keyboard new Scanner(System.in) long A = keyboard.nextLong(); A keyboard.nextLong() keyboard.nextLong keyboard long B = keyboard.nextLong(); B keyboard.nextLong() keyboard.nextLong keyboard long C = keyboard.nextLong(); C keyboard.nextLong() keyboard.nextLong keyboard long X = keyboard.nextLong(); X keyboard.nextLong() keyboard.nextLong keyboard long Y = keyboard.nextLong(); Y keyboard.nextLong() keyboard.nextLong keyboard long Large = X >= Y ? X : Y; Large X >= Y ? X : Y X >= Y X Y X Y long small = X <= Y ? X : Y; small X <= Y ? X : Y X <= Y X Y X Y long sum = 0; sum 0 long nokori = Large - small; nokori Large - small Large small if(A+B > 2*C) {
			sum = small*(2*C);
			
			if(Large == X) {
				if(A < 2*C) {
					sum += nokori*A;
				}else {
					sum += nokori*2*C;
				}
			}else{
				if(B < 2*C) {
					sum += nokori*B;
				}else {
					sum += nokori*2*C;
				}
			}
			
		}else {
			sum = A*X + B*Y;
		} A+B > 2*C A+B A B 2*C 2 C {
			sum = small*(2*C);
			
			if(Large == X) {
				if(A < 2*C) {
					sum += nokori*A;
				}else {
					sum += nokori*2*C;
				}
			}else{
				if(B < 2*C) {
					sum += nokori*B;
				}else {
					sum += nokori*2*C;
				}
			}
			
		} sum = small*(2*C) sum small*(2*C) small (2*C) 2 C if(Large == X) {
				if(A < 2*C) {
					sum += nokori*A;
				}else {
					sum += nokori*2*C;
				}
			}else{
				if(B < 2*C) {
					sum += nokori*B;
				}else {
					sum += nokori*2*C;
				}
			} Large == X Large X {
				if(A < 2*C) {
					sum += nokori*A;
				}else {
					sum += nokori*2*C;
				}
			} if(A < 2*C) {
					sum += nokori*A;
				}else {
					sum += nokori*2*C;
				} A < 2*C A 2*C 2 C {
					sum += nokori*A;
				} sum += nokori*A sum nokori*A nokori A {
					sum += nokori*2*C;
				} sum += nokori*2*C sum nokori*2*C nokori*2*C nokori 2 C {
				if(B < 2*C) {
					sum += nokori*B;
				}else {
					sum += nokori*2*C;
				}
			} if(B < 2*C) {
					sum += nokori*B;
				}else {
					sum += nokori*2*C;
				} B < 2*C B 2*C 2 C {
					sum += nokori*B;
				} sum += nokori*B sum nokori*B nokori B {
					sum += nokori*2*C;
				} sum += nokori*2*C sum nokori*2*C nokori*2*C nokori 2 C {
			sum = A*X + B*Y;
		} sum = A*X + B*Y sum A*X + B*Y A*X A X B*Y B Y System.out.print(sum) System.out.print System.out System System.out sum keyboard.close() keyboard.close keyboard String[] args args public class Main {
	public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		long A = keyboard.nextLong();
		long B = keyboard.nextLong();
		long C = keyboard.nextLong();
		long X = keyboard.nextLong();
		long Y = keyboard.nextLong();
		
		long Large = X >= Y ? X : Y;
		long small = X <= Y ? X : Y; 
		
		long sum = 0;
		long nokori = Large - small;
		
		if(A+B > 2*C) {
			sum = small*(2*C);
			
			if(Large == X) {
				if(A < 2*C) {
					sum += nokori*A;
				}else {
					sum += nokori*2*C;
				}
			}else{
				if(B < 2*C) {
					sum += nokori*B;
				}else {
					sum += nokori*2*C;
				}
			}
			
		}else {
			sum = A*X + B*Y;
		}
		
		System.out.print(sum);
		keyboard.close();
	}
} public class Main {
	public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		long A = keyboard.nextLong();
		long B = keyboard.nextLong();
		long C = keyboard.nextLong();
		long X = keyboard.nextLong();
		long Y = keyboard.nextLong();
		
		long Large = X >= Y ? X : Y;
		long small = X <= Y ? X : Y; 
		
		long sum = 0;
		long nokori = Large - small;
		
		if(A+B > 2*C) {
			sum = small*(2*C);
			
			if(Large == X) {
				if(A < 2*C) {
					sum += nokori*A;
				}else {
					sum += nokori*2*C;
				}
			}else{
				if(B < 2*C) {
					sum += nokori*B;
				}else {
					sum += nokori*2*C;
				}
			}
			
		}else {
			sum = A*X + B*Y;
		}
		
		System.out.print(sum);
		keyboard.close();
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		long A = keyboard.nextLong();
		long B = keyboard.nextLong();
		long C = keyboard.nextLong();
		long X = keyboard.nextLong();
		long Y = keyboard.nextLong();
		
		long Large = X >= Y ? X : Y;
		long small = X <= Y ? X : Y; 
		
		long sum = 0;
		long nokori = Large - small;
		
		if(A+B > 2*C) {
			sum = small*(2*C);
			
			if(Large == X) {
				if(A < 2*C) {
					sum += nokori*A;
				}else {
					sum += nokori*2*C;
				}
			}else{
				if(B < 2*C) {
					sum += nokori*B;
				}else {
					sum += nokori*2*C;
				}
			}
			
		}else {
			sum = A*X + B*Y;
		}
		
		System.out.print(sum);
		keyboard.close();
	}
}