import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int A = in.nextInt();
		int B = in.nextInt();
		int C = in.nextInt();
		int X = in.nextInt();
		int Y = in.nextInt();
		int ans = 0;
		if (A + B > C * 2) {
			int min = Math.min(X, Y);
			ans += (min * C) * 2;
			if (X > min) {
				if (A > C * 2) {
					ans += (X - min) * C * 2;
				} else {
					ans += (X - min) * A;
				}
			} else if (Y > min) {
				if (B > C * 2) {
					ans += (Y - min) * C * 2;
				} else {
					ans += (Y - min) * B;
				}
			}
		} else {
			ans += A * X + B * Y;
		}
		System.out.println(ans);
		in.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {

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

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

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int A = in.nextInt();
		int B = in.nextInt();
		int C = in.nextInt();
		int X = in.nextInt();
		int Y = in.nextInt();
		int ans = 0;
		if (A + B > C * 2) {
			int min = Math.min(X, Y);
			ans += (min * C) * 2;
			if (X > min) {
				if (A > C * 2) {
					ans += (X - min) * C * 2;
				} else {
					ans += (X - min) * A;
				}
			} else if (Y > min) {
				if (B > C * 2) {
					ans += (Y - min) * C * 2;
				} else {
					ans += (Y - min) * B;
				}
			}
		} else {
			ans += A * X + B * Y;
		}
		System.out.println(ans);
		in.close();
	}
} Main
import java.util.Scanner;

public class Main {

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