
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		//		new Main().solveA();
		//		new Main().solveB();
		new Main().solveC();
		// new Main().solveD();
	}

	private void solveA() {
		Scanner scanner = null;
		String topping = "";

		try {
			scanner = new Scanner(System.in);
			topping = scanner.next();

			int res = 700;

			for (int i = 0; i < topping.length(); i++) {
				switch (topping.charAt(i)) {
				case 'o':
					res += 100;
					break;
				case 'x':
					break;

				}
			}

			System.out.println(res);

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveB() {
		Scanner scanner = null;
		int numN = 0;
		int numX = 0;

		try {
			scanner = new Scanner(System.in);
			numN = scanner.nextInt();
			numX = scanner.nextInt();

			int[] wk = new int[numN];

			int res = 0;
			for (int i = 0; i < numN; i++) {
				wk[i] = scanner.nextInt();
				res++;
				numX -= wk[i];
			}

			Arrays.sort(wk);

			boolean isExit = false;
			while (!isExit) {
				if (numX >= wk[0]) {
					numX -= wk[0];
					res++;
				} else {
					isExit = true;
				}
			}

			System.out.println(res);

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveC() {
		Scanner scanner = null;
		int numA = 0;
		int numB = 0;
		int numC = 0;
		int numX = 0;
		int numY = 0;

		try {
			scanner = new Scanner(System.in);
			numA = scanner.nextInt();
			numB = scanner.nextInt();
			numC = scanner.nextInt();
			numX = scanner.nextInt();
			numY = scanner.nextInt();

			int sabun0 = Math.abs(numX - numY);
			int sabun1 = Math.min(numX, numY);

			int res = 0;
			if (numA + numB > numC * 2) {
				res += sabun1 * (numC * 2);
			} else if (numA + numB == numC * 2) {
				res += sabun1 * (numC * 2);
			} else if (numA + numB < numC * 2) {
				res += sabun1 * (numA + numB);
			}

			if (numX > numY) {
				if (numA <= numC * 2) {
					res += (numX - sabun1) * numA;
				} else {
					res += (numX - sabun1) * (numC * 2);
				}
			} else if (numX < numY) {
				if (numB <= numC * 2) {
					res += (numY - sabun1) * numB;
				} else {
					res += (numY - sabun1) * (numC * 2);
				}
			}

			System.out.println(res);

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveD() {
		Scanner scanner = null;
		int numN = 0;
		int numK = 0;
		int numS = 0;

		try {
			scanner = new Scanner(System.in);
			numN = scanner.nextInt();

			System.out.println("");

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		//		new Main().solveA();
		//		new Main().solveB();
		new Main().solveC();
		// new Main().solveD();
	}

	private void solveA() {
		Scanner scanner = null;
		String topping = "";

		try {
			scanner = new Scanner(System.in);
			topping = scanner.next();

			int res = 700;

			for (int i = 0; i < topping.length(); i++) {
				switch (topping.charAt(i)) {
				case 'o':
					res += 100;
					break;
				case 'x':
					break;

				}
			}

			System.out.println(res);

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveB() {
		Scanner scanner = null;
		int numN = 0;
		int numX = 0;

		try {
			scanner = new Scanner(System.in);
			numN = scanner.nextInt();
			numX = scanner.nextInt();

			int[] wk = new int[numN];

			int res = 0;
			for (int i = 0; i < numN; i++) {
				wk[i] = scanner.nextInt();
				res++;
				numX -= wk[i];
			}

			Arrays.sort(wk);

			boolean isExit = false;
			while (!isExit) {
				if (numX >= wk[0]) {
					numX -= wk[0];
					res++;
				} else {
					isExit = true;
				}
			}

			System.out.println(res);

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveC() {
		Scanner scanner = null;
		int numA = 0;
		int numB = 0;
		int numC = 0;
		int numX = 0;
		int numY = 0;

		try {
			scanner = new Scanner(System.in);
			numA = scanner.nextInt();
			numB = scanner.nextInt();
			numC = scanner.nextInt();
			numX = scanner.nextInt();
			numY = scanner.nextInt();

			int sabun0 = Math.abs(numX - numY);
			int sabun1 = Math.min(numX, numY);

			int res = 0;
			if (numA + numB > numC * 2) {
				res += sabun1 * (numC * 2);
			} else if (numA + numB == numC * 2) {
				res += sabun1 * (numC * 2);
			} else if (numA + numB < numC * 2) {
				res += sabun1 * (numA + numB);
			}

			if (numX > numY) {
				if (numA <= numC * 2) {
					res += (numX - sabun1) * numA;
				} else {
					res += (numX - sabun1) * (numC * 2);
				}
			} else if (numX < numY) {
				if (numB <= numC * 2) {
					res += (numY - sabun1) * numB;
				} else {
					res += (numY - sabun1) * (numC * 2);
				}
			}

			System.out.println(res);

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveD() {
		Scanner scanner = null;
		int numN = 0;
		int numK = 0;
		int numS = 0;

		try {
			scanner = new Scanner(System.in);
			numN = scanner.nextInt();

			System.out.println("");

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}
} Main public static void main(String[] args) {
		//		new Main().solveA();
		//		new Main().solveB();
		new Main().solveC();
		// new Main().solveD();
	} main {
		//		new Main().solveA();
		//		new Main().solveB();
		new Main().solveC();
		// new Main().solveD();
	} new Main().solveC() new Main().solveC new Main() String[] args args private void solveA() {
		Scanner scanner = null;
		String topping = "";

		try {
			scanner = new Scanner(System.in);
			topping = scanner.next();

			int res = 700;

			for (int i = 0; i < topping.length(); i++) {
				switch (topping.charAt(i)) {
				case 'o':
					res += 100;
					break;
				case 'x':
					break;

				}
			}

			System.out.println(res);

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	} solveA {
		Scanner scanner = null;
		String topping = "";

		try {
			scanner = new Scanner(System.in);
			topping = scanner.next();

			int res = 700;

			for (int i = 0; i < topping.length(); i++) {
				switch (topping.charAt(i)) {
				case 'o':
					res += 100;
					break;
				case 'x':
					break;

				}
			}

			System.out.println(res);

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	} Scanner scanner = null; scanner null String topping = ""; topping "" try {
			scanner = new Scanner(System.in);
			topping = scanner.next();

			int res = 700;

			for (int i = 0; i < topping.length(); i++) {
				switch (topping.charAt(i)) {
				case 'o':
					res += 100;
					break;
				case 'x':
					break;

				}
			}

			System.out.println(res);

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		} {
			if (scanner != null) {
				scanner.close();
			}
		} if (scanner != null) {
				scanner.close();
			} scanner != null scanner null {
				scanner.close();
			} scanner.close() scanner.close scanner {
			scanner = new Scanner(System.in);
			topping = scanner.next();

			int res = 700;

			for (int i = 0; i < topping.length(); i++) {
				switch (topping.charAt(i)) {
				case 'o':
					res += 100;
					break;
				case 'x':
					break;

				}
			}

			System.out.println(res);

		} scanner = new Scanner(System.in) scanner new Scanner(System.in) topping = scanner.next() topping scanner.next() scanner.next scanner int res = 700; res 700 for (int i = 0; i < topping.length(); i++) {
				switch (topping.charAt(i)) {
				case 'o':
					res += 100;
					break;
				case 'x':
					break;

				}
			} int i = 0; int i = 0; i 0 i < topping.length() i topping.length() topping.length topping i++ i++ i {
				switch (topping.charAt(i)) {
				case 'o':
					res += 100;
					break;
				case 'x':
					break;

				}
			} {
				switch (topping.charAt(i)) {
				case 'o':
					res += 100;
					break;
				case 'x':
					break;

				}
			} switch (topping.charAt(i)) {
				case 'o':
					res += 100;
					break;
				case 'x':
					break;

				} topping.charAt(i) topping.charAt topping i case 'o': 'o' case 'o': res += 100 res 100 break; case 'x': 'x' case 'x': break; System.out.println(res) System.out.println System.out System System.out res private void solveB() {
		Scanner scanner = null;
		int numN = 0;
		int numX = 0;

		try {
			scanner = new Scanner(System.in);
			numN = scanner.nextInt();
			numX = scanner.nextInt();

			int[] wk = new int[numN];

			int res = 0;
			for (int i = 0; i < numN; i++) {
				wk[i] = scanner.nextInt();
				res++;
				numX -= wk[i];
			}

			Arrays.sort(wk);

			boolean isExit = false;
			while (!isExit) {
				if (numX >= wk[0]) {
					numX -= wk[0];
					res++;
				} else {
					isExit = true;
				}
			}

			System.out.println(res);

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	} solveB {
		Scanner scanner = null;
		int numN = 0;
		int numX = 0;

		try {
			scanner = new Scanner(System.in);
			numN = scanner.nextInt();
			numX = scanner.nextInt();

			int[] wk = new int[numN];

			int res = 0;
			for (int i = 0; i < numN; i++) {
				wk[i] = scanner.nextInt();
				res++;
				numX -= wk[i];
			}

			Arrays.sort(wk);

			boolean isExit = false;
			while (!isExit) {
				if (numX >= wk[0]) {
					numX -= wk[0];
					res++;
				} else {
					isExit = true;
				}
			}

			System.out.println(res);

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	} Scanner scanner = null; scanner null int numN = 0; numN 0 int numX = 0; numX 0 try {
			scanner = new Scanner(System.in);
			numN = scanner.nextInt();
			numX = scanner.nextInt();

			int[] wk = new int[numN];

			int res = 0;
			for (int i = 0; i < numN; i++) {
				wk[i] = scanner.nextInt();
				res++;
				numX -= wk[i];
			}

			Arrays.sort(wk);

			boolean isExit = false;
			while (!isExit) {
				if (numX >= wk[0]) {
					numX -= wk[0];
					res++;
				} else {
					isExit = true;
				}
			}

			System.out.println(res);

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		} {
			if (scanner != null) {
				scanner.close();
			}
		} if (scanner != null) {
				scanner.close();
			} scanner != null scanner null {
				scanner.close();
			} scanner.close() scanner.close scanner {
			scanner = new Scanner(System.in);
			numN = scanner.nextInt();
			numX = scanner.nextInt();

			int[] wk = new int[numN];

			int res = 0;
			for (int i = 0; i < numN; i++) {
				wk[i] = scanner.nextInt();
				res++;
				numX -= wk[i];
			}

			Arrays.sort(wk);

			boolean isExit = false;
			while (!isExit) {
				if (numX >= wk[0]) {
					numX -= wk[0];
					res++;
				} else {
					isExit = true;
				}
			}

			System.out.println(res);

		} scanner = new Scanner(System.in) scanner new Scanner(System.in) numN = scanner.nextInt() numN scanner.nextInt() scanner.nextInt scanner numX = scanner.nextInt() numX scanner.nextInt() scanner.nextInt scanner int[] wk = new int[numN]; wk new int[numN] numN int res = 0; res 0 for (int i = 0; i < numN; i++) {
				wk[i] = scanner.nextInt();
				res++;
				numX -= wk[i];
			} int i = 0; int i = 0; i 0 i < numN i numN i++ i++ i {
				wk[i] = scanner.nextInt();
				res++;
				numX -= wk[i];
			} {
				wk[i] = scanner.nextInt();
				res++;
				numX -= wk[i];
			} wk[i] = scanner.nextInt() wk[i] wk i scanner.nextInt() scanner.nextInt scanner res++ res numX -= wk[i] numX wk[i] wk i Arrays.sort(wk) Arrays.sort Arrays wk boolean isExit = false; isExit false while (!isExit) {
				if (numX >= wk[0]) {
					numX -= wk[0];
					res++;
				} else {
					isExit = true;
				}
			} !isExit isExit {
				if (numX >= wk[0]) {
					numX -= wk[0];
					res++;
				} else {
					isExit = true;
				}
			} if (numX >= wk[0]) {
					numX -= wk[0];
					res++;
				} else {
					isExit = true;
				} numX >= wk[0] numX wk[0] wk 0 {
					numX -= wk[0];
					res++;
				} numX -= wk[0] numX wk[0] wk 0 res++ res {
					isExit = true;
				} isExit = true isExit true System.out.println(res) System.out.println System.out System System.out res private void solveC() {
		Scanner scanner = null;
		int numA = 0;
		int numB = 0;
		int numC = 0;
		int numX = 0;
		int numY = 0;

		try {
			scanner = new Scanner(System.in);
			numA = scanner.nextInt();
			numB = scanner.nextInt();
			numC = scanner.nextInt();
			numX = scanner.nextInt();
			numY = scanner.nextInt();

			int sabun0 = Math.abs(numX - numY);
			int sabun1 = Math.min(numX, numY);

			int res = 0;
			if (numA + numB > numC * 2) {
				res += sabun1 * (numC * 2);
			} else if (numA + numB == numC * 2) {
				res += sabun1 * (numC * 2);
			} else if (numA + numB < numC * 2) {
				res += sabun1 * (numA + numB);
			}

			if (numX > numY) {
				if (numA <= numC * 2) {
					res += (numX - sabun1) * numA;
				} else {
					res += (numX - sabun1) * (numC * 2);
				}
			} else if (numX < numY) {
				if (numB <= numC * 2) {
					res += (numY - sabun1) * numB;
				} else {
					res += (numY - sabun1) * (numC * 2);
				}
			}

			System.out.println(res);

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	} solveC {
		Scanner scanner = null;
		int numA = 0;
		int numB = 0;
		int numC = 0;
		int numX = 0;
		int numY = 0;

		try {
			scanner = new Scanner(System.in);
			numA = scanner.nextInt();
			numB = scanner.nextInt();
			numC = scanner.nextInt();
			numX = scanner.nextInt();
			numY = scanner.nextInt();

			int sabun0 = Math.abs(numX - numY);
			int sabun1 = Math.min(numX, numY);

			int res = 0;
			if (numA + numB > numC * 2) {
				res += sabun1 * (numC * 2);
			} else if (numA + numB == numC * 2) {
				res += sabun1 * (numC * 2);
			} else if (numA + numB < numC * 2) {
				res += sabun1 * (numA + numB);
			}

			if (numX > numY) {
				if (numA <= numC * 2) {
					res += (numX - sabun1) * numA;
				} else {
					res += (numX - sabun1) * (numC * 2);
				}
			} else if (numX < numY) {
				if (numB <= numC * 2) {
					res += (numY - sabun1) * numB;
				} else {
					res += (numY - sabun1) * (numC * 2);
				}
			}

			System.out.println(res);

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	} Scanner scanner = null; scanner null int numA = 0; numA 0 int numB = 0; numB 0 int numC = 0; numC 0 int numX = 0; numX 0 int numY = 0; numY 0 try {
			scanner = new Scanner(System.in);
			numA = scanner.nextInt();
			numB = scanner.nextInt();
			numC = scanner.nextInt();
			numX = scanner.nextInt();
			numY = scanner.nextInt();

			int sabun0 = Math.abs(numX - numY);
			int sabun1 = Math.min(numX, numY);

			int res = 0;
			if (numA + numB > numC * 2) {
				res += sabun1 * (numC * 2);
			} else if (numA + numB == numC * 2) {
				res += sabun1 * (numC * 2);
			} else if (numA + numB < numC * 2) {
				res += sabun1 * (numA + numB);
			}

			if (numX > numY) {
				if (numA <= numC * 2) {
					res += (numX - sabun1) * numA;
				} else {
					res += (numX - sabun1) * (numC * 2);
				}
			} else if (numX < numY) {
				if (numB <= numC * 2) {
					res += (numY - sabun1) * numB;
				} else {
					res += (numY - sabun1) * (numC * 2);
				}
			}

			System.out.println(res);

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		} {
			if (scanner != null) {
				scanner.close();
			}
		} if (scanner != null) {
				scanner.close();
			} scanner != null scanner null {
				scanner.close();
			} scanner.close() scanner.close scanner {
			scanner = new Scanner(System.in);
			numA = scanner.nextInt();
			numB = scanner.nextInt();
			numC = scanner.nextInt();
			numX = scanner.nextInt();
			numY = scanner.nextInt();

			int sabun0 = Math.abs(numX - numY);
			int sabun1 = Math.min(numX, numY);

			int res = 0;
			if (numA + numB > numC * 2) {
				res += sabun1 * (numC * 2);
			} else if (numA + numB == numC * 2) {
				res += sabun1 * (numC * 2);
			} else if (numA + numB < numC * 2) {
				res += sabun1 * (numA + numB);
			}

			if (numX > numY) {
				if (numA <= numC * 2) {
					res += (numX - sabun1) * numA;
				} else {
					res += (numX - sabun1) * (numC * 2);
				}
			} else if (numX < numY) {
				if (numB <= numC * 2) {
					res += (numY - sabun1) * numB;
				} else {
					res += (numY - sabun1) * (numC * 2);
				}
			}

			System.out.println(res);

		} scanner = new Scanner(System.in) scanner new Scanner(System.in) numA = scanner.nextInt() numA scanner.nextInt() scanner.nextInt scanner numB = scanner.nextInt() numB scanner.nextInt() scanner.nextInt scanner numC = scanner.nextInt() numC scanner.nextInt() scanner.nextInt scanner numX = scanner.nextInt() numX scanner.nextInt() scanner.nextInt scanner numY = scanner.nextInt() numY scanner.nextInt() scanner.nextInt scanner int sabun0 = Math.abs(numX - numY); sabun0 Math.abs(numX - numY) Math.abs Math numX - numY numX numY int sabun1 = Math.min(numX, numY); sabun1 Math.min(numX, numY) Math.min Math numX numY int res = 0; res 0 if (numA + numB > numC * 2) {
				res += sabun1 * (numC * 2);
			} else if (numA + numB == numC * 2) {
				res += sabun1 * (numC * 2);
			} else if (numA + numB < numC * 2) {
				res += sabun1 * (numA + numB);
			} numA + numB > numC * 2 numA + numB numA numB numC * 2 numC 2 {
				res += sabun1 * (numC * 2);
			} res += sabun1 * (numC * 2) res sabun1 * (numC * 2) sabun1 (numC * 2) numC 2 if (numA + numB == numC * 2) {
				res += sabun1 * (numC * 2);
			} else if (numA + numB < numC * 2) {
				res += sabun1 * (numA + numB);
			} numA + numB == numC * 2 numA + numB numA numB numC * 2 numC 2 {
				res += sabun1 * (numC * 2);
			} res += sabun1 * (numC * 2) res sabun1 * (numC * 2) sabun1 (numC * 2) numC 2 if (numA + numB < numC * 2) {
				res += sabun1 * (numA + numB);
			} numA + numB < numC * 2 numA + numB numA numB numC * 2 numC 2 {
				res += sabun1 * (numA + numB);
			} res += sabun1 * (numA + numB) res sabun1 * (numA + numB) sabun1 (numA + numB) numA numB if (numX > numY) {
				if (numA <= numC * 2) {
					res += (numX - sabun1) * numA;
				} else {
					res += (numX - sabun1) * (numC * 2);
				}
			} else if (numX < numY) {
				if (numB <= numC * 2) {
					res += (numY - sabun1) * numB;
				} else {
					res += (numY - sabun1) * (numC * 2);
				}
			} numX > numY numX numY {
				if (numA <= numC * 2) {
					res += (numX - sabun1) * numA;
				} else {
					res += (numX - sabun1) * (numC * 2);
				}
			} if (numA <= numC * 2) {
					res += (numX - sabun1) * numA;
				} else {
					res += (numX - sabun1) * (numC * 2);
				} numA <= numC * 2 numA numC * 2 numC 2 {
					res += (numX - sabun1) * numA;
				} res += (numX - sabun1) * numA res (numX - sabun1) * numA (numX - sabun1) numX sabun1 numA {
					res += (numX - sabun1) * (numC * 2);
				} res += (numX - sabun1) * (numC * 2) res (numX - sabun1) * (numC * 2) (numX - sabun1) numX sabun1 (numC * 2) numC 2 if (numX < numY) {
				if (numB <= numC * 2) {
					res += (numY - sabun1) * numB;
				} else {
					res += (numY - sabun1) * (numC * 2);
				}
			} numX < numY numX numY {
				if (numB <= numC * 2) {
					res += (numY - sabun1) * numB;
				} else {
					res += (numY - sabun1) * (numC * 2);
				}
			} if (numB <= numC * 2) {
					res += (numY - sabun1) * numB;
				} else {
					res += (numY - sabun1) * (numC * 2);
				} numB <= numC * 2 numB numC * 2 numC 2 {
					res += (numY - sabun1) * numB;
				} res += (numY - sabun1) * numB res (numY - sabun1) * numB (numY - sabun1) numY sabun1 numB {
					res += (numY - sabun1) * (numC * 2);
				} res += (numY - sabun1) * (numC * 2) res (numY - sabun1) * (numC * 2) (numY - sabun1) numY sabun1 (numC * 2) numC 2 System.out.println(res) System.out.println System.out System System.out res private void solveD() {
		Scanner scanner = null;
		int numN = 0;
		int numK = 0;
		int numS = 0;

		try {
			scanner = new Scanner(System.in);
			numN = scanner.nextInt();

			System.out.println("");

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	} solveD {
		Scanner scanner = null;
		int numN = 0;
		int numK = 0;
		int numS = 0;

		try {
			scanner = new Scanner(System.in);
			numN = scanner.nextInt();

			System.out.println("");

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	} Scanner scanner = null; scanner null int numN = 0; numN 0 int numK = 0; numK 0 int numS = 0; numS 0 try {
			scanner = new Scanner(System.in);
			numN = scanner.nextInt();

			System.out.println("");

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		} {
			if (scanner != null) {
				scanner.close();
			}
		} if (scanner != null) {
				scanner.close();
			} scanner != null scanner null {
				scanner.close();
			} scanner.close() scanner.close scanner {
			scanner = new Scanner(System.in);
			numN = scanner.nextInt();

			System.out.println("");

		} scanner = new Scanner(System.in) scanner new Scanner(System.in) numN = scanner.nextInt() numN scanner.nextInt() scanner.nextInt scanner System.out.println("") System.out.println System.out System System.out "" public class Main {

	public static void main(String[] args) {
		//		new Main().solveA();
		//		new Main().solveB();
		new Main().solveC();
		// new Main().solveD();
	}

	private void solveA() {
		Scanner scanner = null;
		String topping = "";

		try {
			scanner = new Scanner(System.in);
			topping = scanner.next();

			int res = 700;

			for (int i = 0; i < topping.length(); i++) {
				switch (topping.charAt(i)) {
				case 'o':
					res += 100;
					break;
				case 'x':
					break;

				}
			}

			System.out.println(res);

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveB() {
		Scanner scanner = null;
		int numN = 0;
		int numX = 0;

		try {
			scanner = new Scanner(System.in);
			numN = scanner.nextInt();
			numX = scanner.nextInt();

			int[] wk = new int[numN];

			int res = 0;
			for (int i = 0; i < numN; i++) {
				wk[i] = scanner.nextInt();
				res++;
				numX -= wk[i];
			}

			Arrays.sort(wk);

			boolean isExit = false;
			while (!isExit) {
				if (numX >= wk[0]) {
					numX -= wk[0];
					res++;
				} else {
					isExit = true;
				}
			}

			System.out.println(res);

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveC() {
		Scanner scanner = null;
		int numA = 0;
		int numB = 0;
		int numC = 0;
		int numX = 0;
		int numY = 0;

		try {
			scanner = new Scanner(System.in);
			numA = scanner.nextInt();
			numB = scanner.nextInt();
			numC = scanner.nextInt();
			numX = scanner.nextInt();
			numY = scanner.nextInt();

			int sabun0 = Math.abs(numX - numY);
			int sabun1 = Math.min(numX, numY);

			int res = 0;
			if (numA + numB > numC * 2) {
				res += sabun1 * (numC * 2);
			} else if (numA + numB == numC * 2) {
				res += sabun1 * (numC * 2);
			} else if (numA + numB < numC * 2) {
				res += sabun1 * (numA + numB);
			}

			if (numX > numY) {
				if (numA <= numC * 2) {
					res += (numX - sabun1) * numA;
				} else {
					res += (numX - sabun1) * (numC * 2);
				}
			} else if (numX < numY) {
				if (numB <= numC * 2) {
					res += (numY - sabun1) * numB;
				} else {
					res += (numY - sabun1) * (numC * 2);
				}
			}

			System.out.println(res);

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveD() {
		Scanner scanner = null;
		int numN = 0;
		int numK = 0;
		int numS = 0;

		try {
			scanner = new Scanner(System.in);
			numN = scanner.nextInt();

			System.out.println("");

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}
} public class Main {

	public static void main(String[] args) {
		//		new Main().solveA();
		//		new Main().solveB();
		new Main().solveC();
		// new Main().solveD();
	}

	private void solveA() {
		Scanner scanner = null;
		String topping = "";

		try {
			scanner = new Scanner(System.in);
			topping = scanner.next();

			int res = 700;

			for (int i = 0; i < topping.length(); i++) {
				switch (topping.charAt(i)) {
				case 'o':
					res += 100;
					break;
				case 'x':
					break;

				}
			}

			System.out.println(res);

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveB() {
		Scanner scanner = null;
		int numN = 0;
		int numX = 0;

		try {
			scanner = new Scanner(System.in);
			numN = scanner.nextInt();
			numX = scanner.nextInt();

			int[] wk = new int[numN];

			int res = 0;
			for (int i = 0; i < numN; i++) {
				wk[i] = scanner.nextInt();
				res++;
				numX -= wk[i];
			}

			Arrays.sort(wk);

			boolean isExit = false;
			while (!isExit) {
				if (numX >= wk[0]) {
					numX -= wk[0];
					res++;
				} else {
					isExit = true;
				}
			}

			System.out.println(res);

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveC() {
		Scanner scanner = null;
		int numA = 0;
		int numB = 0;
		int numC = 0;
		int numX = 0;
		int numY = 0;

		try {
			scanner = new Scanner(System.in);
			numA = scanner.nextInt();
			numB = scanner.nextInt();
			numC = scanner.nextInt();
			numX = scanner.nextInt();
			numY = scanner.nextInt();

			int sabun0 = Math.abs(numX - numY);
			int sabun1 = Math.min(numX, numY);

			int res = 0;
			if (numA + numB > numC * 2) {
				res += sabun1 * (numC * 2);
			} else if (numA + numB == numC * 2) {
				res += sabun1 * (numC * 2);
			} else if (numA + numB < numC * 2) {
				res += sabun1 * (numA + numB);
			}

			if (numX > numY) {
				if (numA <= numC * 2) {
					res += (numX - sabun1) * numA;
				} else {
					res += (numX - sabun1) * (numC * 2);
				}
			} else if (numX < numY) {
				if (numB <= numC * 2) {
					res += (numY - sabun1) * numB;
				} else {
					res += (numY - sabun1) * (numC * 2);
				}
			}

			System.out.println(res);

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveD() {
		Scanner scanner = null;
		int numN = 0;
		int numK = 0;
		int numS = 0;

		try {
			scanner = new Scanner(System.in);
			numN = scanner.nextInt();

			System.out.println("");

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}
} Main

import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		//		new Main().solveA();
		//		new Main().solveB();
		new Main().solveC();
		// new Main().solveD();
	}

	private void solveA() {
		Scanner scanner = null;
		String topping = "";

		try {
			scanner = new Scanner(System.in);
			topping = scanner.next();

			int res = 700;

			for (int i = 0; i < topping.length(); i++) {
				switch (topping.charAt(i)) {
				case 'o':
					res += 100;
					break;
				case 'x':
					break;

				}
			}

			System.out.println(res);

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveB() {
		Scanner scanner = null;
		int numN = 0;
		int numX = 0;

		try {
			scanner = new Scanner(System.in);
			numN = scanner.nextInt();
			numX = scanner.nextInt();

			int[] wk = new int[numN];

			int res = 0;
			for (int i = 0; i < numN; i++) {
				wk[i] = scanner.nextInt();
				res++;
				numX -= wk[i];
			}

			Arrays.sort(wk);

			boolean isExit = false;
			while (!isExit) {
				if (numX >= wk[0]) {
					numX -= wk[0];
					res++;
				} else {
					isExit = true;
				}
			}

			System.out.println(res);

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveC() {
		Scanner scanner = null;
		int numA = 0;
		int numB = 0;
		int numC = 0;
		int numX = 0;
		int numY = 0;

		try {
			scanner = new Scanner(System.in);
			numA = scanner.nextInt();
			numB = scanner.nextInt();
			numC = scanner.nextInt();
			numX = scanner.nextInt();
			numY = scanner.nextInt();

			int sabun0 = Math.abs(numX - numY);
			int sabun1 = Math.min(numX, numY);

			int res = 0;
			if (numA + numB > numC * 2) {
				res += sabun1 * (numC * 2);
			} else if (numA + numB == numC * 2) {
				res += sabun1 * (numC * 2);
			} else if (numA + numB < numC * 2) {
				res += sabun1 * (numA + numB);
			}

			if (numX > numY) {
				if (numA <= numC * 2) {
					res += (numX - sabun1) * numA;
				} else {
					res += (numX - sabun1) * (numC * 2);
				}
			} else if (numX < numY) {
				if (numB <= numC * 2) {
					res += (numY - sabun1) * numB;
				} else {
					res += (numY - sabun1) * (numC * 2);
				}
			}

			System.out.println(res);

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveD() {
		Scanner scanner = null;
		int numN = 0;
		int numK = 0;
		int numS = 0;

		try {
			scanner = new Scanner(System.in);
			numN = scanner.nextInt();

			System.out.println("");

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}
}