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() * 2;
		int x = sc.nextInt();
		int y = sc.nextInt();

		int max = x > y ? x : y;

		int min = Integer.MAX_VALUE;
		for(int i = 0; i <= max; i++) {
			// cの分
			int sum = i * c;

			// aの分を足りない分を買い足す
			if(x > i)
				sum += (x - i) * a;

			// bの分を足りない分を買い足す
			if(y > i)
				sum += (y - i) * b;

			min = min < sum ? min : sum;
		}
		System.out.print(min);
	}
} 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() * 2;
		int x = sc.nextInt();
		int y = sc.nextInt();

		int max = x > y ? x : y;

		int min = Integer.MAX_VALUE;
		for(int i = 0; i <= max; i++) {
			// cの分
			int sum = i * c;

			// aの分を足りない分を買い足す
			if(x > i)
				sum += (x - i) * a;

			// bの分を足りない分を買い足す
			if(y > i)
				sum += (y - i) * b;

			min = min < sum ? min : sum;
		}
		System.out.print(min);
	}
} 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() * 2;
		int x = sc.nextInt();
		int y = sc.nextInt();

		int max = x > y ? x : y;

		int min = Integer.MAX_VALUE;
		for(int i = 0; i <= max; i++) {
			// cの分
			int sum = i * c;

			// aの分を足りない分を買い足す
			if(x > i)
				sum += (x - i) * a;

			// bの分を足りない分を買い足す
			if(y > i)
				sum += (y - i) * b;

			min = min < sum ? min : sum;
		}
		System.out.print(min);
	} main {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt() * 2;
		int x = sc.nextInt();
		int y = sc.nextInt();

		int max = x > y ? x : y;

		int min = Integer.MAX_VALUE;
		for(int i = 0; i <= max; i++) {
			// cの分
			int sum = i * c;

			// aの分を足りない分を買い足す
			if(x > i)
				sum += (x - i) * a;

			// bの分を足りない分を買い足す
			if(y > i)
				sum += (y - i) * b;

			min = min < sum ? min : sum;
		}
		System.out.print(min);
	} 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() * 2; c sc.nextInt() * 2 sc.nextInt() sc.nextInt sc 2 int x = sc.nextInt(); x sc.nextInt() sc.nextInt sc int y = sc.nextInt(); y sc.nextInt() sc.nextInt sc int max = x > y ? x : y; max x > y ? x : y x > y x y x y int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE for(int i = 0; i <= max; i++) {
			// cの分
			int sum = i * c;

			// aの分を足りない分を買い足す
			if(x > i)
				sum += (x - i) * a;

			// bの分を足りない分を買い足す
			if(y > i)
				sum += (y - i) * b;

			min = min < sum ? min : sum;
		} int i = 0; int i = 0; i 0 i <= max i max i++ i++ i {
			// cの分
			int sum = i * c;

			// aの分を足りない分を買い足す
			if(x > i)
				sum += (x - i) * a;

			// bの分を足りない分を買い足す
			if(y > i)
				sum += (y - i) * b;

			min = min < sum ? min : sum;
		} {
			// cの分
			int sum = i * c;

			// aの分を足りない分を買い足す
			if(x > i)
				sum += (x - i) * a;

			// bの分を足りない分を買い足す
			if(y > i)
				sum += (y - i) * b;

			min = min < sum ? min : sum;
		} int sum = i * c; sum i * c i c if(x > i)
				sum += (x - i) * a; x > i x i sum += (x - i) * a sum (x - i) * a (x - i) x i a if(y > i)
				sum += (y - i) * b; y > i y i sum += (y - i) * b sum (y - i) * b (y - i) y i b min = min < sum ? min : sum min min < sum ? min : sum min < sum min sum min sum System.out.print(min) System.out.print System.out System System.out min 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() * 2;
		int x = sc.nextInt();
		int y = sc.nextInt();

		int max = x > y ? x : y;

		int min = Integer.MAX_VALUE;
		for(int i = 0; i <= max; i++) {
			// cの分
			int sum = i * c;

			// aの分を足りない分を買い足す
			if(x > i)
				sum += (x - i) * a;

			// bの分を足りない分を買い足す
			if(y > i)
				sum += (y - i) * b;

			min = min < sum ? min : sum;
		}
		System.out.print(min);
	}
} 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() * 2;
		int x = sc.nextInt();
		int y = sc.nextInt();

		int max = x > y ? x : y;

		int min = Integer.MAX_VALUE;
		for(int i = 0; i <= max; i++) {
			// cの分
			int sum = i * c;

			// aの分を足りない分を買い足す
			if(x > i)
				sum += (x - i) * a;

			// bの分を足りない分を買い足す
			if(y > i)
				sum += (y - i) * b;

			min = min < sum ? min : sum;
		}
		System.out.print(min);
	}
} 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() * 2;
		int x = sc.nextInt();
		int y = sc.nextInt();

		int max = x > y ? x : y;

		int min = Integer.MAX_VALUE;
		for(int i = 0; i <= max; i++) {
			// cの分
			int sum = i * c;

			// aの分を足りない分を買い足す
			if(x > i)
				sum += (x - i) * a;

			// bの分を足りない分を買い足す
			if(y > i)
				sum += (y - i) * b;

			min = min < sum ? min : sum;
		}
		System.out.print(min);
	}
}
