import java.util.*;

public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int X = sc.nextInt();
		int Y = sc.nextInt();
		if(A + B > 2 * C) {
			if(A > 2 * C && B > 2 * C) {
				System.out.println(Math.max(X, Y) * C * 2);
			} else if(A > 2 * C) {
				if(X > Y) {
					System.out.println(X * C * 2);
				} else {
					System.out.println(X * C * 2 + (Y - X) * B);
				}
			} else if(B > 2 * C){
				if(X > Y) {
					System.out.println(Y * C * 2 + (X - Y) * A);
				} else {
					System.out.println(Y * C * 2);
				}
			} else {
				if(X > Y) {
					System.out.println(Y * C * 2 + (X - Y) * A);
				} else {
					System.out.println(X * C * 2 + (Y - X) * B);
				}
			}
		} else {
			System.out.println(A * X + B * Y);
		}
	}
} import java.util.*; util.* java public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int X = sc.nextInt();
		int Y = sc.nextInt();
		if(A + B > 2 * C) {
			if(A > 2 * C && B > 2 * C) {
				System.out.println(Math.max(X, Y) * C * 2);
			} else if(A > 2 * C) {
				if(X > Y) {
					System.out.println(X * C * 2);
				} else {
					System.out.println(X * C * 2 + (Y - X) * B);
				}
			} else if(B > 2 * C){
				if(X > Y) {
					System.out.println(Y * C * 2 + (X - Y) * A);
				} else {
					System.out.println(Y * C * 2);
				}
			} else {
				if(X > Y) {
					System.out.println(Y * C * 2 + (X - Y) * A);
				} else {
					System.out.println(X * C * 2 + (Y - X) * B);
				}
			}
		} else {
			System.out.println(A * X + B * Y);
		}
	}
} Main public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int X = sc.nextInt();
		int Y = sc.nextInt();
		if(A + B > 2 * C) {
			if(A > 2 * C && B > 2 * C) {
				System.out.println(Math.max(X, Y) * C * 2);
			} else if(A > 2 * C) {
				if(X > Y) {
					System.out.println(X * C * 2);
				} else {
					System.out.println(X * C * 2 + (Y - X) * B);
				}
			} else if(B > 2 * C){
				if(X > Y) {
					System.out.println(Y * C * 2 + (X - Y) * A);
				} else {
					System.out.println(Y * C * 2);
				}
			} else {
				if(X > Y) {
					System.out.println(Y * C * 2 + (X - Y) * A);
				} else {
					System.out.println(X * C * 2 + (Y - X) * B);
				}
			}
		} else {
			System.out.println(A * X + B * Y);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int X = sc.nextInt();
		int Y = sc.nextInt();
		if(A + B > 2 * C) {
			if(A > 2 * C && B > 2 * C) {
				System.out.println(Math.max(X, Y) * C * 2);
			} else if(A > 2 * C) {
				if(X > Y) {
					System.out.println(X * C * 2);
				} else {
					System.out.println(X * C * 2 + (Y - X) * B);
				}
			} else if(B > 2 * C){
				if(X > Y) {
					System.out.println(Y * C * 2 + (X - Y) * A);
				} else {
					System.out.println(Y * C * 2);
				}
			} else {
				if(X > Y) {
					System.out.println(Y * C * 2 + (X - Y) * A);
				} else {
					System.out.println(X * C * 2 + (Y - X) * B);
				}
			}
		} else {
			System.out.println(A * X + B * Y);
		}
	} 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 X = sc.nextInt(); X sc.nextInt() sc.nextInt sc int Y = sc.nextInt(); Y sc.nextInt() sc.nextInt sc if(A + B > 2 * C) {
			if(A > 2 * C && B > 2 * C) {
				System.out.println(Math.max(X, Y) * C * 2);
			} else if(A > 2 * C) {
				if(X > Y) {
					System.out.println(X * C * 2);
				} else {
					System.out.println(X * C * 2 + (Y - X) * B);
				}
			} else if(B > 2 * C){
				if(X > Y) {
					System.out.println(Y * C * 2 + (X - Y) * A);
				} else {
					System.out.println(Y * C * 2);
				}
			} else {
				if(X > Y) {
					System.out.println(Y * C * 2 + (X - Y) * A);
				} else {
					System.out.println(X * C * 2 + (Y - X) * B);
				}
			}
		} else {
			System.out.println(A * X + B * Y);
		} A + B > 2 * C A + B A B 2 * C 2 C {
			if(A > 2 * C && B > 2 * C) {
				System.out.println(Math.max(X, Y) * C * 2);
			} else if(A > 2 * C) {
				if(X > Y) {
					System.out.println(X * C * 2);
				} else {
					System.out.println(X * C * 2 + (Y - X) * B);
				}
			} else if(B > 2 * C){
				if(X > Y) {
					System.out.println(Y * C * 2 + (X - Y) * A);
				} else {
					System.out.println(Y * C * 2);
				}
			} else {
				if(X > Y) {
					System.out.println(Y * C * 2 + (X - Y) * A);
				} else {
					System.out.println(X * C * 2 + (Y - X) * B);
				}
			}
		} if(A > 2 * C && B > 2 * C) {
				System.out.println(Math.max(X, Y) * C * 2);
			} else if(A > 2 * C) {
				if(X > Y) {
					System.out.println(X * C * 2);
				} else {
					System.out.println(X * C * 2 + (Y - X) * B);
				}
			} else if(B > 2 * C){
				if(X > Y) {
					System.out.println(Y * C * 2 + (X - Y) * A);
				} else {
					System.out.println(Y * C * 2);
				}
			} else {
				if(X > Y) {
					System.out.println(Y * C * 2 + (X - Y) * A);
				} else {
					System.out.println(X * C * 2 + (Y - X) * B);
				}
			} A > 2 * C && B > 2 * C A > 2 * C A 2 * C 2 C B > 2 * C B 2 * C 2 C {
				System.out.println(Math.max(X, Y) * C * 2);
			} System.out.println(Math.max(X, Y) * C * 2) System.out.println System.out System System.out Math.max(X, Y) * C * 2 Math.max(X, Y) * C * 2 Math.max(X, Y) Math.max Math X Y C 2 if(A > 2 * C) {
				if(X > Y) {
					System.out.println(X * C * 2);
				} else {
					System.out.println(X * C * 2 + (Y - X) * B);
				}
			} else if(B > 2 * C){
				if(X > Y) {
					System.out.println(Y * C * 2 + (X - Y) * A);
				} else {
					System.out.println(Y * C * 2);
				}
			} else {
				if(X > Y) {
					System.out.println(Y * C * 2 + (X - Y) * A);
				} else {
					System.out.println(X * C * 2 + (Y - X) * B);
				}
			} A > 2 * C A 2 * C 2 C {
				if(X > Y) {
					System.out.println(X * C * 2);
				} else {
					System.out.println(X * C * 2 + (Y - X) * B);
				}
			} if(X > Y) {
					System.out.println(X * C * 2);
				} else {
					System.out.println(X * C * 2 + (Y - X) * B);
				} X > Y X Y {
					System.out.println(X * C * 2);
				} System.out.println(X * C * 2) System.out.println System.out System System.out X * C * 2 X * C * 2 X C 2 {
					System.out.println(X * C * 2 + (Y - X) * B);
				} System.out.println(X * C * 2 + (Y - X) * B) System.out.println System.out System System.out X * C * 2 + (Y - X) * B X * C * 2 X * C * 2 X C 2 (Y - X) * B (Y - X) Y X B if(B > 2 * C){
				if(X > Y) {
					System.out.println(Y * C * 2 + (X - Y) * A);
				} else {
					System.out.println(Y * C * 2);
				}
			} else {
				if(X > Y) {
					System.out.println(Y * C * 2 + (X - Y) * A);
				} else {
					System.out.println(X * C * 2 + (Y - X) * B);
				}
			} B > 2 * C B 2 * C 2 C {
				if(X > Y) {
					System.out.println(Y * C * 2 + (X - Y) * A);
				} else {
					System.out.println(Y * C * 2);
				}
			} if(X > Y) {
					System.out.println(Y * C * 2 + (X - Y) * A);
				} else {
					System.out.println(Y * C * 2);
				} X > Y X Y {
					System.out.println(Y * C * 2 + (X - Y) * A);
				} System.out.println(Y * C * 2 + (X - Y) * A) System.out.println System.out System System.out Y * C * 2 + (X - Y) * A Y * C * 2 Y * C * 2 Y C 2 (X - Y) * A (X - Y) X Y A {
					System.out.println(Y * C * 2);
				} System.out.println(Y * C * 2) System.out.println System.out System System.out Y * C * 2 Y * C * 2 Y C 2 {
				if(X > Y) {
					System.out.println(Y * C * 2 + (X - Y) * A);
				} else {
					System.out.println(X * C * 2 + (Y - X) * B);
				}
			} if(X > Y) {
					System.out.println(Y * C * 2 + (X - Y) * A);
				} else {
					System.out.println(X * C * 2 + (Y - X) * B);
				} X > Y X Y {
					System.out.println(Y * C * 2 + (X - Y) * A);
				} System.out.println(Y * C * 2 + (X - Y) * A) System.out.println System.out System System.out Y * C * 2 + (X - Y) * A Y * C * 2 Y * C * 2 Y C 2 (X - Y) * A (X - Y) X Y A {
					System.out.println(X * C * 2 + (Y - X) * B);
				} System.out.println(X * C * 2 + (Y - X) * B) System.out.println System.out System System.out X * C * 2 + (Y - X) * B X * C * 2 X * C * 2 X C 2 (Y - X) * B (Y - X) Y X B {
			System.out.println(A * X + B * Y);
		} System.out.println(A * X + B * Y) System.out.println System.out System System.out A * X + B * Y A * X A X B * Y B Y String args[] args public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int X = sc.nextInt();
		int Y = sc.nextInt();
		if(A + B > 2 * C) {
			if(A > 2 * C && B > 2 * C) {
				System.out.println(Math.max(X, Y) * C * 2);
			} else if(A > 2 * C) {
				if(X > Y) {
					System.out.println(X * C * 2);
				} else {
					System.out.println(X * C * 2 + (Y - X) * B);
				}
			} else if(B > 2 * C){
				if(X > Y) {
					System.out.println(Y * C * 2 + (X - Y) * A);
				} else {
					System.out.println(Y * C * 2);
				}
			} else {
				if(X > Y) {
					System.out.println(Y * C * 2 + (X - Y) * A);
				} else {
					System.out.println(X * C * 2 + (Y - X) * B);
				}
			}
		} else {
			System.out.println(A * X + B * Y);
		}
	}
} public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int X = sc.nextInt();
		int Y = sc.nextInt();
		if(A + B > 2 * C) {
			if(A > 2 * C && B > 2 * C) {
				System.out.println(Math.max(X, Y) * C * 2);
			} else if(A > 2 * C) {
				if(X > Y) {
					System.out.println(X * C * 2);
				} else {
					System.out.println(X * C * 2 + (Y - X) * B);
				}
			} else if(B > 2 * C){
				if(X > Y) {
					System.out.println(Y * C * 2 + (X - Y) * A);
				} else {
					System.out.println(Y * C * 2);
				}
			} else {
				if(X > Y) {
					System.out.println(Y * C * 2 + (X - Y) * A);
				} else {
					System.out.println(X * C * 2 + (Y - X) * B);
				}
			}
		} else {
			System.out.println(A * X + B * Y);
		}
	}
} Main
import java.util.*;

public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int X = sc.nextInt();
		int Y = sc.nextInt();
		if(A + B > 2 * C) {
			if(A > 2 * C && B > 2 * C) {
				System.out.println(Math.max(X, Y) * C * 2);
			} else if(A > 2 * C) {
				if(X > Y) {
					System.out.println(X * C * 2);
				} else {
					System.out.println(X * C * 2 + (Y - X) * B);
				}
			} else if(B > 2 * C){
				if(X > Y) {
					System.out.println(Y * C * 2 + (X - Y) * A);
				} else {
					System.out.println(Y * C * 2);
				}
			} else {
				if(X > Y) {
					System.out.println(Y * C * 2 + (X - Y) * A);
				} else {
					System.out.println(X * C * 2 + (Y - X) * B);
				}
			}
		} else {
			System.out.println(A * X + B * Y);
		}
	}
}
