import java.util.Scanner;
import java.io.*;

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 a = Integer.MAX_VALUE;
		int max =Math.max(X, Y);
		long temp;
		long money = A*X + B*Y;
		//System.out.println(money);
		for(int i = 1;i <= max;i++){
			if(Y <= i) Y = i;
			if(X <= i) X = i;
			temp = A*(X-i) + B*(Y-i) + 2*C*i;
			//System.out.println(temp);
			if(money > temp) money = temp;
			//System.out.println(i);
		}

		System.out.println(money);
		//System.out.println(a);
	}
} import java.util.Scanner; Scanner java.util import java.io.*; io.* java 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 a = Integer.MAX_VALUE;
		int max =Math.max(X, Y);
		long temp;
		long money = A*X + B*Y;
		//System.out.println(money);
		for(int i = 1;i <= max;i++){
			if(Y <= i) Y = i;
			if(X <= i) X = i;
			temp = A*(X-i) + B*(Y-i) + 2*C*i;
			//System.out.println(temp);
			if(money > temp) money = temp;
			//System.out.println(i);
		}

		System.out.println(money);
		//System.out.println(a);
	}
} 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 a = Integer.MAX_VALUE;
		int max =Math.max(X, Y);
		long temp;
		long money = A*X + B*Y;
		//System.out.println(money);
		for(int i = 1;i <= max;i++){
			if(Y <= i) Y = i;
			if(X <= i) X = i;
			temp = A*(X-i) + B*(Y-i) + 2*C*i;
			//System.out.println(temp);
			if(money > temp) money = temp;
			//System.out.println(i);
		}

		System.out.println(money);
		//System.out.println(a);
	} 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 a = Integer.MAX_VALUE;
		int max =Math.max(X, Y);
		long temp;
		long money = A*X + B*Y;
		//System.out.println(money);
		for(int i = 1;i <= max;i++){
			if(Y <= i) Y = i;
			if(X <= i) X = i;
			temp = A*(X-i) + B*(Y-i) + 2*C*i;
			//System.out.println(temp);
			if(money > temp) money = temp;
			//System.out.println(i);
		}

		System.out.println(money);
		//System.out.println(a);
	} 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 max =Math.max(X, Y); max Math.max(X, Y) Math.max Math X Y long temp; temp long money = A*X + B*Y; money A*X + B*Y A*X A X B*Y B Y for(int i = 1;i <= max;i++){
			if(Y <= i) Y = i;
			if(X <= i) X = i;
			temp = A*(X-i) + B*(Y-i) + 2*C*i;
			//System.out.println(temp);
			if(money > temp) money = temp;
			//System.out.println(i);
		} int i = 1; int i = 1; i 1 i <= max i max i++ i++ i {
			if(Y <= i) Y = i;
			if(X <= i) X = i;
			temp = A*(X-i) + B*(Y-i) + 2*C*i;
			//System.out.println(temp);
			if(money > temp) money = temp;
			//System.out.println(i);
		} {
			if(Y <= i) Y = i;
			if(X <= i) X = i;
			temp = A*(X-i) + B*(Y-i) + 2*C*i;
			//System.out.println(temp);
			if(money > temp) money = temp;
			//System.out.println(i);
		} if(Y <= i) Y = i; Y <= i Y i Y = i Y i if(X <= i) X = i; X <= i X i X = i X i temp = A*(X-i) + B*(Y-i) + 2*C*i temp A*(X-i) + B*(Y-i) + 2*C*i A*(X-i) + B*(Y-i) + 2*C*i A*(X-i) A (X-i) X i B*(Y-i) B (Y-i) Y i 2*C*i 2*C*i 2 C i if(money > temp) money = temp; money > temp money temp money = temp money temp System.out.println(money) System.out.println System.out System System.out money String[] args args
import java.util.Scanner;
import java.io.*;

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 a = Integer.MAX_VALUE;
		int max =Math.max(X, Y);
		long temp;
		long money = A*X + B*Y;
		//System.out.println(money);
		for(int i = 1;i <= max;i++){
			if(Y <= i) Y = i;
			if(X <= i) X = i;
			temp = A*(X-i) + B*(Y-i) + 2*C*i;
			//System.out.println(temp);
			if(money > temp) money = temp;
			//System.out.println(i);
		}

		System.out.println(money);
		//System.out.println(a);
	}
}