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

	public static int search(int A,int B,int AB,int X,int Y) {
		int ans = Integer.MAX_VALUE;
		int I = X>Y? X : Y;

		for(int i = 0; i <= I; i++) {
			int a = Math.max(X - i,0);
			int b = Math.max(Y - i,0);
			ans = Math.min(ans,a*A + b*B + 2*i*AB);
		}
		return ans;
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int A = scan.nextInt();
		int B = scan.nextInt();
		int AB = scan.nextInt();
		int X = scan.nextInt();
		int Y = scan.nextInt();
		System.out.println(search(A,B,AB,X,Y));
	}

	public static int search(int A,int B,int AB,int X,int Y) {
		int ans = Integer.MAX_VALUE;
		int I = X>Y? X : Y;

		for(int i = 0; i <= I; i++) {
			int a = Math.max(X - i,0);
			int b = Math.max(Y - i,0);
			ans = Math.min(ans,a*A + b*B + 2*i*AB);
		}
		return ans;
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int A = scan.nextInt();
		int B = scan.nextInt();
		int AB = scan.nextInt();
		int X = scan.nextInt();
		int Y = scan.nextInt();
		System.out.println(search(A,B,AB,X,Y));
	} main {
		Scanner scan = new Scanner(System.in);
		int A = scan.nextInt();
		int B = scan.nextInt();
		int AB = scan.nextInt();
		int X = scan.nextInt();
		int Y = scan.nextInt();
		System.out.println(search(A,B,AB,X,Y));
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int A = scan.nextInt(); A scan.nextInt() scan.nextInt scan int B = scan.nextInt(); B scan.nextInt() scan.nextInt scan int AB = scan.nextInt(); AB scan.nextInt() scan.nextInt scan int X = scan.nextInt(); X scan.nextInt() scan.nextInt scan int Y = scan.nextInt(); Y scan.nextInt() scan.nextInt scan System.out.println(search(A,B,AB,X,Y)) System.out.println System.out System System.out search(A,B,AB,X,Y) search A B AB X Y String[] args args public static int search(int A,int B,int AB,int X,int Y) {
		int ans = Integer.MAX_VALUE;
		int I = X>Y? X : Y;

		for(int i = 0; i <= I; i++) {
			int a = Math.max(X - i,0);
			int b = Math.max(Y - i,0);
			ans = Math.min(ans,a*A + b*B + 2*i*AB);
		}
		return ans;
	} search {
		int ans = Integer.MAX_VALUE;
		int I = X>Y? X : Y;

		for(int i = 0; i <= I; i++) {
			int a = Math.max(X - i,0);
			int b = Math.max(Y - i,0);
			ans = Math.min(ans,a*A + b*B + 2*i*AB);
		}
		return ans;
	} int ans = Integer.MAX_VALUE; ans Integer.MAX_VALUE Integer Integer.MAX_VALUE int I = X>Y? X : Y; I X>Y? X : Y X>Y X Y X Y for(int i = 0; i <= I; i++) {
			int a = Math.max(X - i,0);
			int b = Math.max(Y - i,0);
			ans = Math.min(ans,a*A + b*B + 2*i*AB);
		} int i = 0; int i = 0; i 0 i <= I i I i++ i++ i {
			int a = Math.max(X - i,0);
			int b = Math.max(Y - i,0);
			ans = Math.min(ans,a*A + b*B + 2*i*AB);
		} {
			int a = Math.max(X - i,0);
			int b = Math.max(Y - i,0);
			ans = Math.min(ans,a*A + b*B + 2*i*AB);
		} int a = Math.max(X - i,0); a Math.max(X - i,0) Math.max Math X - i X i 0 int b = Math.max(Y - i,0); b Math.max(Y - i,0) Math.max Math Y - i Y i 0 ans = Math.min(ans,a*A + b*B + 2*i*AB) ans Math.min(ans,a*A + b*B + 2*i*AB) Math.min Math ans a*A + b*B + 2*i*AB a*A + b*B + 2*i*AB a*A a A b*B b B 2*i*AB 2*i*AB 2 i AB return ans; ans int A A int B B int AB AB int X X int Y Y public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int A = scan.nextInt();
		int B = scan.nextInt();
		int AB = scan.nextInt();
		int X = scan.nextInt();
		int Y = scan.nextInt();
		System.out.println(search(A,B,AB,X,Y));
	}

	public static int search(int A,int B,int AB,int X,int Y) {
		int ans = Integer.MAX_VALUE;
		int I = X>Y? X : Y;

		for(int i = 0; i <= I; i++) {
			int a = Math.max(X - i,0);
			int b = Math.max(Y - i,0);
			ans = Math.min(ans,a*A + b*B + 2*i*AB);
		}
		return ans;
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int A = scan.nextInt();
		int B = scan.nextInt();
		int AB = scan.nextInt();
		int X = scan.nextInt();
		int Y = scan.nextInt();
		System.out.println(search(A,B,AB,X,Y));
	}

	public static int search(int A,int B,int AB,int X,int Y) {
		int ans = Integer.MAX_VALUE;
		int I = X>Y? X : Y;

		for(int i = 0; i <= I; i++) {
			int a = Math.max(X - i,0);
			int b = Math.max(Y - i,0);
			ans = Math.min(ans,a*A + b*B + 2*i*AB);
		}
		return ans;
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int A = scan.nextInt();
		int B = scan.nextInt();
		int AB = scan.nextInt();
		int X = scan.nextInt();
		int Y = scan.nextInt();
		System.out.println(search(A,B,AB,X,Y));
	}

	public static int search(int A,int B,int AB,int X,int Y) {
		int ans = Integer.MAX_VALUE;
		int I = X>Y? X : Y;

		for(int i = 0; i <= I; i++) {
			int a = Math.max(X - i,0);
			int b = Math.max(Y - i,0);
			ans = Math.min(ans,a*A + b*B + 2*i*AB);
		}
		return ans;
	}
}
