import java.util.Scanner;

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();
		int total = A * X + B * Y;
		if (X > Y) {
			for (int i = 0; i <= 2 *X ;  i += 2) {

				if (total > A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i) {
					total = (int) (A * Math.max(0, X - 0.5 * i)+ B * Math.max(0, Y - 0.5 * i) + C * i);
				}
			}
		} else {
			for (int i = 0; i <=  2 *Y; i += 2) {
				if (total > A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i) {
					total = (int) (A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i);
				}
			}
		}
		System.out.println(total);

	}
} import java.util.Scanner; Scanner 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();
		int total = A * X + B * Y;
		if (X > Y) {
			for (int i = 0; i <= 2 *X ;  i += 2) {

				if (total > A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i) {
					total = (int) (A * Math.max(0, X - 0.5 * i)+ B * Math.max(0, Y - 0.5 * i) + C * i);
				}
			}
		} else {
			for (int i = 0; i <=  2 *Y; i += 2) {
				if (total > A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i) {
					total = (int) (A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i);
				}
			}
		}
		System.out.println(total);

	}
} 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();
		int total = A * X + B * Y;
		if (X > Y) {
			for (int i = 0; i <= 2 *X ;  i += 2) {

				if (total > A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i) {
					total = (int) (A * Math.max(0, X - 0.5 * i)+ B * Math.max(0, Y - 0.5 * i) + C * i);
				}
			}
		} else {
			for (int i = 0; i <=  2 *Y; i += 2) {
				if (total > A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i) {
					total = (int) (A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i);
				}
			}
		}
		System.out.println(total);

	} 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();
		int total = A * X + B * Y;
		if (X > Y) {
			for (int i = 0; i <= 2 *X ;  i += 2) {

				if (total > A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i) {
					total = (int) (A * Math.max(0, X - 0.5 * i)+ B * Math.max(0, Y - 0.5 * i) + C * i);
				}
			}
		} else {
			for (int i = 0; i <=  2 *Y; i += 2) {
				if (total > A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i) {
					total = (int) (A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i);
				}
			}
		}
		System.out.println(total);

	} 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 int total = A * X + B * Y; total A * X + B * Y A * X A X B * Y B Y if (X > Y) {
			for (int i = 0; i <= 2 *X ;  i += 2) {

				if (total > A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i) {
					total = (int) (A * Math.max(0, X - 0.5 * i)+ B * Math.max(0, Y - 0.5 * i) + C * i);
				}
			}
		} else {
			for (int i = 0; i <=  2 *Y; i += 2) {
				if (total > A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i) {
					total = (int) (A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i);
				}
			}
		} X > Y X Y {
			for (int i = 0; i <= 2 *X ;  i += 2) {

				if (total > A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i) {
					total = (int) (A * Math.max(0, X - 0.5 * i)+ B * Math.max(0, Y - 0.5 * i) + C * i);
				}
			}
		} for (int i = 0; i <= 2 *X ;  i += 2) {

				if (total > A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i) {
					total = (int) (A * Math.max(0, X - 0.5 * i)+ B * Math.max(0, Y - 0.5 * i) + C * i);
				}
			} int i = 0; int i = 0; i 0 i <= 2 *X i 2 *X 2 X i += 2 i += 2 i 2 {

				if (total > A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i) {
					total = (int) (A * Math.max(0, X - 0.5 * i)+ B * Math.max(0, Y - 0.5 * i) + C * i);
				}
			} {

				if (total > A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i) {
					total = (int) (A * Math.max(0, X - 0.5 * i)+ B * Math.max(0, Y - 0.5 * i) + C * i);
				}
			} if (total > A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i) {
					total = (int) (A * Math.max(0, X - 0.5 * i)+ B * Math.max(0, Y - 0.5 * i) + C * i);
				} total > A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i total A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i A * Math.max(0, X - 0.5 * i) A Math.max(0, X - 0.5 * i) Math.max Math 0 X - 0.5 * i X 0.5 * i 0.5 i B * Math.max(0, Y - 0.5 * i) B Math.max(0, Y - 0.5 * i) Math.max Math 0 Y - 0.5 * i Y 0.5 * i 0.5 i C * i C i {
					total = (int) (A * Math.max(0, X - 0.5 * i)+ B * Math.max(0, Y - 0.5 * i) + C * i);
				} total = (int) (A * Math.max(0, X - 0.5 * i)+ B * Math.max(0, Y - 0.5 * i) + C * i) total (int) (A * Math.max(0, X - 0.5 * i)+ B * Math.max(0, Y - 0.5 * i) + C * i) A * Math.max(0, X - 0.5 * i)+ B * Math.max(0, Y - 0.5 * i) + C * i A * Math.max(0, X - 0.5 * i) A Math.max(0, X - 0.5 * i) Math.max Math 0 X - 0.5 * i X 0.5 * i 0.5 i B * Math.max(0, Y - 0.5 * i) B Math.max(0, Y - 0.5 * i) Math.max Math 0 Y - 0.5 * i Y 0.5 * i 0.5 i C * i C i {
			for (int i = 0; i <=  2 *Y; i += 2) {
				if (total > A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i) {
					total = (int) (A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i);
				}
			}
		} for (int i = 0; i <=  2 *Y; i += 2) {
				if (total > A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i) {
					total = (int) (A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i);
				}
			} int i = 0; int i = 0; i 0 i <=  2 *Y i 2 *Y 2 Y i += 2 i += 2 i 2 {
				if (total > A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i) {
					total = (int) (A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i);
				}
			} {
				if (total > A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i) {
					total = (int) (A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i);
				}
			} if (total > A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i) {
					total = (int) (A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i);
				} total > A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i total A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i A * Math.max(0, X - 0.5 * i) A Math.max(0, X - 0.5 * i) Math.max Math 0 X - 0.5 * i X 0.5 * i 0.5 i B * Math.max(0, Y - 0.5 * i) B Math.max(0, Y - 0.5 * i) Math.max Math 0 Y - 0.5 * i Y 0.5 * i 0.5 i C * i C i {
					total = (int) (A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i);
				} total = (int) (A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i) total (int) (A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i) A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i A * Math.max(0, X - 0.5 * i) A Math.max(0, X - 0.5 * i) Math.max Math 0 X - 0.5 * i X 0.5 * i 0.5 i B * Math.max(0, Y - 0.5 * i) B Math.max(0, Y - 0.5 * i) Math.max Math 0 Y - 0.5 * i Y 0.5 * i 0.5 i C * i C i System.out.println(total) System.out.println System.out System System.out total 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();
		int total = A * X + B * Y;
		if (X > Y) {
			for (int i = 0; i <= 2 *X ;  i += 2) {

				if (total > A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i) {
					total = (int) (A * Math.max(0, X - 0.5 * i)+ B * Math.max(0, Y - 0.5 * i) + C * i);
				}
			}
		} else {
			for (int i = 0; i <=  2 *Y; i += 2) {
				if (total > A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i) {
					total = (int) (A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i);
				}
			}
		}
		System.out.println(total);

	}
} 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();
		int total = A * X + B * Y;
		if (X > Y) {
			for (int i = 0; i <= 2 *X ;  i += 2) {

				if (total > A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i) {
					total = (int) (A * Math.max(0, X - 0.5 * i)+ B * Math.max(0, Y - 0.5 * i) + C * i);
				}
			}
		} else {
			for (int i = 0; i <=  2 *Y; i += 2) {
				if (total > A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i) {
					total = (int) (A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i);
				}
			}
		}
		System.out.println(total);

	}
} Main
import java.util.Scanner;

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();
		int total = A * X + B * Y;
		if (X > Y) {
			for (int i = 0; i <= 2 *X ;  i += 2) {

				if (total > A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i) {
					total = (int) (A * Math.max(0, X - 0.5 * i)+ B * Math.max(0, Y - 0.5 * i) + C * i);
				}
			}
		} else {
			for (int i = 0; i <=  2 *Y; i += 2) {
				if (total > A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i) {
					total = (int) (A * Math.max(0, X - 0.5 * i) + B * Math.max(0, Y - 0.5 * i) + C * i);
				}
			}
		}
		System.out.println(total);

	}
}
