import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
	public static void main(String[] Arguments) throws IOException 
	{
		BufferedReader BR = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer ST = new StringTokenizer(BR.readLine());
		long A = Integer.parseInt(ST.nextToken()), B = Integer.parseInt(ST.nextToken()), C = Integer.parseInt(ST.nextToken()), X = Integer.parseInt(ST.nextToken()), Y = Integer.parseInt(ST.nextToken());
		//he buys a and b pizzas:
		long costAB = A * X + B * Y;
		long Same = Math.min(X, Y);
		X -= Same; Y -= Same;
		long costCombine = Same * 2 * C + A * X + B * Y;
		long totalCost = Same * 2 * C + Math.max(X, Y) * 2 * C;
		long Best = Math.min(costAB, costCombine);
		Best = Math.min(Best, totalCost);
		System.out.println(Best);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.StringTokenizer; StringTokenizer java.util public class Main {
	public static void main(String[] Arguments) throws IOException 
	{
		BufferedReader BR = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer ST = new StringTokenizer(BR.readLine());
		long A = Integer.parseInt(ST.nextToken()), B = Integer.parseInt(ST.nextToken()), C = Integer.parseInt(ST.nextToken()), X = Integer.parseInt(ST.nextToken()), Y = Integer.parseInt(ST.nextToken());
		//he buys a and b pizzas:
		long costAB = A * X + B * Y;
		long Same = Math.min(X, Y);
		X -= Same; Y -= Same;
		long costCombine = Same * 2 * C + A * X + B * Y;
		long totalCost = Same * 2 * C + Math.max(X, Y) * 2 * C;
		long Best = Math.min(costAB, costCombine);
		Best = Math.min(Best, totalCost);
		System.out.println(Best);
	}
} Main public static void main(String[] Arguments) throws IOException 
	{
		BufferedReader BR = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer ST = new StringTokenizer(BR.readLine());
		long A = Integer.parseInt(ST.nextToken()), B = Integer.parseInt(ST.nextToken()), C = Integer.parseInt(ST.nextToken()), X = Integer.parseInt(ST.nextToken()), Y = Integer.parseInt(ST.nextToken());
		//he buys a and b pizzas:
		long costAB = A * X + B * Y;
		long Same = Math.min(X, Y);
		X -= Same; Y -= Same;
		long costCombine = Same * 2 * C + A * X + B * Y;
		long totalCost = Same * 2 * C + Math.max(X, Y) * 2 * C;
		long Best = Math.min(costAB, costCombine);
		Best = Math.min(Best, totalCost);
		System.out.println(Best);
	} main {
		BufferedReader BR = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer ST = new StringTokenizer(BR.readLine());
		long A = Integer.parseInt(ST.nextToken()), B = Integer.parseInt(ST.nextToken()), C = Integer.parseInt(ST.nextToken()), X = Integer.parseInt(ST.nextToken()), Y = Integer.parseInt(ST.nextToken());
		//he buys a and b pizzas:
		long costAB = A * X + B * Y;
		long Same = Math.min(X, Y);
		X -= Same; Y -= Same;
		long costCombine = Same * 2 * C + A * X + B * Y;
		long totalCost = Same * 2 * C + Math.max(X, Y) * 2 * C;
		long Best = Math.min(costAB, costCombine);
		Best = Math.min(Best, totalCost);
		System.out.println(Best);
	} BufferedReader BR = new BufferedReader(new InputStreamReader(System.in)); BR new BufferedReader(new InputStreamReader(System.in)) StringTokenizer ST = new StringTokenizer(BR.readLine()); ST new StringTokenizer(BR.readLine()) long A = Integer.parseInt(ST.nextToken()) A Integer.parseInt(ST.nextToken()) Integer.parseInt Integer ST.nextToken() ST.nextToken ST B = Integer.parseInt(ST.nextToken()) B Integer.parseInt(ST.nextToken()) Integer.parseInt Integer ST.nextToken() ST.nextToken ST C = Integer.parseInt(ST.nextToken()) C Integer.parseInt(ST.nextToken()) Integer.parseInt Integer ST.nextToken() ST.nextToken ST X = Integer.parseInt(ST.nextToken()) X Integer.parseInt(ST.nextToken()) Integer.parseInt Integer ST.nextToken() ST.nextToken ST Y = Integer.parseInt(ST.nextToken()); Y Integer.parseInt(ST.nextToken()) Integer.parseInt Integer ST.nextToken() ST.nextToken ST long costAB = A * X + B * Y; costAB A * X + B * Y A * X A X B * Y B Y long Same = Math.min(X, Y); Same Math.min(X, Y) Math.min Math X Y X -= Same X Same Y -= Same Y Same long costCombine = Same * 2 * C + A * X + B * Y; costCombine Same * 2 * C + A * X + B * Y Same * 2 * C + A * X + B * Y Same * 2 * C Same * 2 * C Same 2 C A * X A X B * Y B Y long totalCost = Same * 2 * C + Math.max(X, Y) * 2 * C; totalCost Same * 2 * C + Math.max(X, Y) * 2 * C Same * 2 * C Same * 2 * C Same 2 C Math.max(X, Y) * 2 * C Math.max(X, Y) * 2 * C Math.max(X, Y) Math.max Math X Y 2 C long Best = Math.min(costAB, costCombine); Best Math.min(costAB, costCombine) Math.min Math costAB costCombine Best = Math.min(Best, totalCost) Best Math.min(Best, totalCost) Math.min Math Best totalCost System.out.println(Best) System.out.println System.out System System.out Best String[] Arguments Arguments public class Main {
	public static void main(String[] Arguments) throws IOException 
	{
		BufferedReader BR = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer ST = new StringTokenizer(BR.readLine());
		long A = Integer.parseInt(ST.nextToken()), B = Integer.parseInt(ST.nextToken()), C = Integer.parseInt(ST.nextToken()), X = Integer.parseInt(ST.nextToken()), Y = Integer.parseInt(ST.nextToken());
		//he buys a and b pizzas:
		long costAB = A * X + B * Y;
		long Same = Math.min(X, Y);
		X -= Same; Y -= Same;
		long costCombine = Same * 2 * C + A * X + B * Y;
		long totalCost = Same * 2 * C + Math.max(X, Y) * 2 * C;
		long Best = Math.min(costAB, costCombine);
		Best = Math.min(Best, totalCost);
		System.out.println(Best);
	}
} public class Main {
	public static void main(String[] Arguments) throws IOException 
	{
		BufferedReader BR = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer ST = new StringTokenizer(BR.readLine());
		long A = Integer.parseInt(ST.nextToken()), B = Integer.parseInt(ST.nextToken()), C = Integer.parseInt(ST.nextToken()), X = Integer.parseInt(ST.nextToken()), Y = Integer.parseInt(ST.nextToken());
		//he buys a and b pizzas:
		long costAB = A * X + B * Y;
		long Same = Math.min(X, Y);
		X -= Same; Y -= Same;
		long costCombine = Same * 2 * C + A * X + B * Y;
		long totalCost = Same * 2 * C + Math.max(X, Y) * 2 * C;
		long Best = Math.min(costAB, costCombine);
		Best = Math.min(Best, totalCost);
		System.out.println(Best);
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
	public static void main(String[] Arguments) throws IOException 
	{
		BufferedReader BR = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer ST = new StringTokenizer(BR.readLine());
		long A = Integer.parseInt(ST.nextToken()), B = Integer.parseInt(ST.nextToken()), C = Integer.parseInt(ST.nextToken()), X = Integer.parseInt(ST.nextToken()), Y = Integer.parseInt(ST.nextToken());
		//he buys a and b pizzas:
		long costAB = A * X + B * Y;
		long Same = Math.min(X, Y);
		X -= Same; Y -= Same;
		long costCombine = Same * 2 * C + A * X + B * Y;
		long totalCost = Same * 2 * C + Math.max(X, Y) * 2 * C;
		long Best = Math.min(costAB, costCombine);
		Best = Math.min(Best, totalCost);
		System.out.println(Best);
	}
}
