import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		int A, B, C, X, Y;
		int cost = 0;
		Scanner in = new Scanner(System.in);

		A = Integer.parseInt(in.next());
		B = Integer.parseInt(in.next());
		C = Integer.parseInt(in.next());
		X = Integer.parseInt(in.next());
		Y = Integer.parseInt(in.next());

		int sum = A + B;
		if (C * 2 < sum) {
			cost += C * 2 * Math.min(X, Y);
			if (X > Y) {
				if (A < 2 * C) {
					cost += A * (X - Y);
				} else {
					cost += C * 2 * (X - Y);
				}
			} else {
				if (B < 2 * C) {
					cost += B * (Y - X);
				} else {
					cost += C * 2 * (Y - X);
				}
			}
		} else {
			cost += A * X + B * Y;
		}

		System.out.println(cost);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		int A, B, C, X, Y;
		int cost = 0;
		Scanner in = new Scanner(System.in);

		A = Integer.parseInt(in.next());
		B = Integer.parseInt(in.next());
		C = Integer.parseInt(in.next());
		X = Integer.parseInt(in.next());
		Y = Integer.parseInt(in.next());

		int sum = A + B;
		if (C * 2 < sum) {
			cost += C * 2 * Math.min(X, Y);
			if (X > Y) {
				if (A < 2 * C) {
					cost += A * (X - Y);
				} else {
					cost += C * 2 * (X - Y);
				}
			} else {
				if (B < 2 * C) {
					cost += B * (Y - X);
				} else {
					cost += C * 2 * (Y - X);
				}
			}
		} else {
			cost += A * X + B * Y;
		}

		System.out.println(cost);
	}
} Main public static void main(String[] args) {
		int A, B, C, X, Y;
		int cost = 0;
		Scanner in = new Scanner(System.in);

		A = Integer.parseInt(in.next());
		B = Integer.parseInt(in.next());
		C = Integer.parseInt(in.next());
		X = Integer.parseInt(in.next());
		Y = Integer.parseInt(in.next());

		int sum = A + B;
		if (C * 2 < sum) {
			cost += C * 2 * Math.min(X, Y);
			if (X > Y) {
				if (A < 2 * C) {
					cost += A * (X - Y);
				} else {
					cost += C * 2 * (X - Y);
				}
			} else {
				if (B < 2 * C) {
					cost += B * (Y - X);
				} else {
					cost += C * 2 * (Y - X);
				}
			}
		} else {
			cost += A * X + B * Y;
		}

		System.out.println(cost);
	} main {
		int A, B, C, X, Y;
		int cost = 0;
		Scanner in = new Scanner(System.in);

		A = Integer.parseInt(in.next());
		B = Integer.parseInt(in.next());
		C = Integer.parseInt(in.next());
		X = Integer.parseInt(in.next());
		Y = Integer.parseInt(in.next());

		int sum = A + B;
		if (C * 2 < sum) {
			cost += C * 2 * Math.min(X, Y);
			if (X > Y) {
				if (A < 2 * C) {
					cost += A * (X - Y);
				} else {
					cost += C * 2 * (X - Y);
				}
			} else {
				if (B < 2 * C) {
					cost += B * (Y - X);
				} else {
					cost += C * 2 * (Y - X);
				}
			}
		} else {
			cost += A * X + B * Y;
		}

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

		A = Integer.parseInt(in.next());
		B = Integer.parseInt(in.next());
		C = Integer.parseInt(in.next());
		X = Integer.parseInt(in.next());
		Y = Integer.parseInt(in.next());

		int sum = A + B;
		if (C * 2 < sum) {
			cost += C * 2 * Math.min(X, Y);
			if (X > Y) {
				if (A < 2 * C) {
					cost += A * (X - Y);
				} else {
					cost += C * 2 * (X - Y);
				}
			} else {
				if (B < 2 * C) {
					cost += B * (Y - X);
				} else {
					cost += C * 2 * (Y - X);
				}
			}
		} else {
			cost += A * X + B * Y;
		}

		System.out.println(cost);
	}
} public class Main {
	public static void main(String[] args) {
		int A, B, C, X, Y;
		int cost = 0;
		Scanner in = new Scanner(System.in);

		A = Integer.parseInt(in.next());
		B = Integer.parseInt(in.next());
		C = Integer.parseInt(in.next());
		X = Integer.parseInt(in.next());
		Y = Integer.parseInt(in.next());

		int sum = A + B;
		if (C * 2 < sum) {
			cost += C * 2 * Math.min(X, Y);
			if (X > Y) {
				if (A < 2 * C) {
					cost += A * (X - Y);
				} else {
					cost += C * 2 * (X - Y);
				}
			} else {
				if (B < 2 * C) {
					cost += B * (Y - X);
				} else {
					cost += C * 2 * (Y - X);
				}
			}
		} else {
			cost += A * X + B * Y;
		}

		System.out.println(cost);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		int A, B, C, X, Y;
		int cost = 0;
		Scanner in = new Scanner(System.in);

		A = Integer.parseInt(in.next());
		B = Integer.parseInt(in.next());
		C = Integer.parseInt(in.next());
		X = Integer.parseInt(in.next());
		Y = Integer.parseInt(in.next());

		int sum = A + B;
		if (C * 2 < sum) {
			cost += C * 2 * Math.min(X, Y);
			if (X > Y) {
				if (A < 2 * C) {
					cost += A * (X - Y);
				} else {
					cost += C * 2 * (X - Y);
				}
			} else {
				if (B < 2 * C) {
					cost += B * (Y - X);
				} else {
					cost += C * 2 * (Y - X);
				}
			}
		} else {
			cost += A * X + B * Y;
		}

		System.out.println(cost);
	}
}
