import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int aPrice = stdIn.nextInt();
		int bPrice = stdIn.nextInt();
		int abPrice = stdIn.nextInt();

		int aNeeds = stdIn.nextInt();
		int bNeeds = stdIn.nextInt();

		// 全部ハーフで買う枚数
		int halfAll = Integer.max(aNeeds, bNeeds) * 2;
		int priceAllHalf = halfAll * abPrice;

		// 共通部分はハーフで買う
		int halfCommon = Integer.min(aNeeds, bNeeds) * 2;
		int rest = Math.abs(aNeeds - bNeeds);
		int priceHalfCommon = (halfCommon * abPrice) + (aNeeds > bNeeds ? rest * aPrice : rest * bPrice);

		// 全部別々に買う
		int priceSimply = aPrice * aNeeds + bPrice * bNeeds;
		stdIn.close();


		System.out.println(Integer.min(Integer.min(priceAllHalf, priceHalfCommon),priceSimply));
	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int aPrice = stdIn.nextInt();
		int bPrice = stdIn.nextInt();
		int abPrice = stdIn.nextInt();

		int aNeeds = stdIn.nextInt();
		int bNeeds = stdIn.nextInt();

		// 全部ハーフで買う枚数
		int halfAll = Integer.max(aNeeds, bNeeds) * 2;
		int priceAllHalf = halfAll * abPrice;

		// 共通部分はハーフで買う
		int halfCommon = Integer.min(aNeeds, bNeeds) * 2;
		int rest = Math.abs(aNeeds - bNeeds);
		int priceHalfCommon = (halfCommon * abPrice) + (aNeeds > bNeeds ? rest * aPrice : rest * bPrice);

		// 全部別々に買う
		int priceSimply = aPrice * aNeeds + bPrice * bNeeds;
		stdIn.close();


		System.out.println(Integer.min(Integer.min(priceAllHalf, priceHalfCommon),priceSimply));
	}

} Main public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int aPrice = stdIn.nextInt();
		int bPrice = stdIn.nextInt();
		int abPrice = stdIn.nextInt();

		int aNeeds = stdIn.nextInt();
		int bNeeds = stdIn.nextInt();

		// 全部ハーフで買う枚数
		int halfAll = Integer.max(aNeeds, bNeeds) * 2;
		int priceAllHalf = halfAll * abPrice;

		// 共通部分はハーフで買う
		int halfCommon = Integer.min(aNeeds, bNeeds) * 2;
		int rest = Math.abs(aNeeds - bNeeds);
		int priceHalfCommon = (halfCommon * abPrice) + (aNeeds > bNeeds ? rest * aPrice : rest * bPrice);

		// 全部別々に買う
		int priceSimply = aPrice * aNeeds + bPrice * bNeeds;
		stdIn.close();


		System.out.println(Integer.min(Integer.min(priceAllHalf, priceHalfCommon),priceSimply));
	} main {
		Scanner stdIn = new Scanner(System.in);
		int aPrice = stdIn.nextInt();
		int bPrice = stdIn.nextInt();
		int abPrice = stdIn.nextInt();

		int aNeeds = stdIn.nextInt();
		int bNeeds = stdIn.nextInt();

		// 全部ハーフで買う枚数
		int halfAll = Integer.max(aNeeds, bNeeds) * 2;
		int priceAllHalf = halfAll * abPrice;

		// 共通部分はハーフで買う
		int halfCommon = Integer.min(aNeeds, bNeeds) * 2;
		int rest = Math.abs(aNeeds - bNeeds);
		int priceHalfCommon = (halfCommon * abPrice) + (aNeeds > bNeeds ? rest * aPrice : rest * bPrice);

		// 全部別々に買う
		int priceSimply = aPrice * aNeeds + bPrice * bNeeds;
		stdIn.close();


		System.out.println(Integer.min(Integer.min(priceAllHalf, priceHalfCommon),priceSimply));
	} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int aPrice = stdIn.nextInt(); aPrice stdIn.nextInt() stdIn.nextInt stdIn int bPrice = stdIn.nextInt(); bPrice stdIn.nextInt() stdIn.nextInt stdIn int abPrice = stdIn.nextInt(); abPrice stdIn.nextInt() stdIn.nextInt stdIn int aNeeds = stdIn.nextInt(); aNeeds stdIn.nextInt() stdIn.nextInt stdIn int bNeeds = stdIn.nextInt(); bNeeds stdIn.nextInt() stdIn.nextInt stdIn int halfAll = Integer.max(aNeeds, bNeeds) * 2; halfAll Integer.max(aNeeds, bNeeds) * 2 Integer.max(aNeeds, bNeeds) Integer.max Integer aNeeds bNeeds 2 int priceAllHalf = halfAll * abPrice; priceAllHalf halfAll * abPrice halfAll abPrice int halfCommon = Integer.min(aNeeds, bNeeds) * 2; halfCommon Integer.min(aNeeds, bNeeds) * 2 Integer.min(aNeeds, bNeeds) Integer.min Integer aNeeds bNeeds 2 int rest = Math.abs(aNeeds - bNeeds); rest Math.abs(aNeeds - bNeeds) Math.abs Math aNeeds - bNeeds aNeeds bNeeds int priceHalfCommon = (halfCommon * abPrice) + (aNeeds > bNeeds ? rest * aPrice : rest * bPrice); priceHalfCommon (halfCommon * abPrice) + (aNeeds > bNeeds ? rest * aPrice : rest * bPrice) (halfCommon * abPrice) halfCommon abPrice (aNeeds > bNeeds ? rest * aPrice : rest * bPrice) aNeeds > bNeeds aNeeds bNeeds rest * aPrice rest aPrice rest * bPrice rest bPrice int priceSimply = aPrice * aNeeds + bPrice * bNeeds; priceSimply aPrice * aNeeds + bPrice * bNeeds aPrice * aNeeds aPrice aNeeds bPrice * bNeeds bPrice bNeeds stdIn.close() stdIn.close stdIn System.out.println(Integer.min(Integer.min(priceAllHalf, priceHalfCommon),priceSimply)) System.out.println System.out System System.out Integer.min(Integer.min(priceAllHalf, priceHalfCommon),priceSimply) Integer.min Integer Integer.min(priceAllHalf, priceHalfCommon) Integer.min Integer priceAllHalf priceHalfCommon priceSimply String[] args args public class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int aPrice = stdIn.nextInt();
		int bPrice = stdIn.nextInt();
		int abPrice = stdIn.nextInt();

		int aNeeds = stdIn.nextInt();
		int bNeeds = stdIn.nextInt();

		// 全部ハーフで買う枚数
		int halfAll = Integer.max(aNeeds, bNeeds) * 2;
		int priceAllHalf = halfAll * abPrice;

		// 共通部分はハーフで買う
		int halfCommon = Integer.min(aNeeds, bNeeds) * 2;
		int rest = Math.abs(aNeeds - bNeeds);
		int priceHalfCommon = (halfCommon * abPrice) + (aNeeds > bNeeds ? rest * aPrice : rest * bPrice);

		// 全部別々に買う
		int priceSimply = aPrice * aNeeds + bPrice * bNeeds;
		stdIn.close();


		System.out.println(Integer.min(Integer.min(priceAllHalf, priceHalfCommon),priceSimply));
	}

} public class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int aPrice = stdIn.nextInt();
		int bPrice = stdIn.nextInt();
		int abPrice = stdIn.nextInt();

		int aNeeds = stdIn.nextInt();
		int bNeeds = stdIn.nextInt();

		// 全部ハーフで買う枚数
		int halfAll = Integer.max(aNeeds, bNeeds) * 2;
		int priceAllHalf = halfAll * abPrice;

		// 共通部分はハーフで買う
		int halfCommon = Integer.min(aNeeds, bNeeds) * 2;
		int rest = Math.abs(aNeeds - bNeeds);
		int priceHalfCommon = (halfCommon * abPrice) + (aNeeds > bNeeds ? rest * aPrice : rest * bPrice);

		// 全部別々に買う
		int priceSimply = aPrice * aNeeds + bPrice * bNeeds;
		stdIn.close();


		System.out.println(Integer.min(Integer.min(priceAllHalf, priceHalfCommon),priceSimply));
	}

} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int aPrice = stdIn.nextInt();
		int bPrice = stdIn.nextInt();
		int abPrice = stdIn.nextInt();

		int aNeeds = stdIn.nextInt();
		int bNeeds = stdIn.nextInt();

		// 全部ハーフで買う枚数
		int halfAll = Integer.max(aNeeds, bNeeds) * 2;
		int priceAllHalf = halfAll * abPrice;

		// 共通部分はハーフで買う
		int halfCommon = Integer.min(aNeeds, bNeeds) * 2;
		int rest = Math.abs(aNeeds - bNeeds);
		int priceHalfCommon = (halfCommon * abPrice) + (aNeeds > bNeeds ? rest * aPrice : rest * bPrice);

		// 全部別々に買う
		int priceSimply = aPrice * aNeeds + bPrice * bNeeds;
		stdIn.close();


		System.out.println(Integer.min(Integer.min(priceAllHalf, priceHalfCommon),priceSimply));
	}

}
