
import java.util.Scanner;

public 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();
		long ans = 0;
		int tmp = Math.min(x, y);
		x -= tmp;
		y -= tmp;
		if(a + b < 2 * c) {
			ans += tmp * (a + b);
		} else {
			ans += tmp * 2 * c;
		}
		if(x % 2 == 1) {
			if(a < 2 * c) {
				ans += a;
			} else {
				ans += 2 * c;
			}
			x--;
		}
		if(a < 2 * c) {
			ans += a * x;
		} else {
			ans += 2 * c * x;
		}
		if(y % 2 == 1) {
			if(b < 2 * c) {
				ans += b;
			} else {
				ans += 2 * c;
			}
			y--;
		}
		if(b < 2 * c) {
			ans += b * y;
		} else {
			ans += 2 * c * y;
		}
		System.out.println(ans);
	}

} import java.util.Scanner; Scanner java.util public 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();
		long ans = 0;
		int tmp = Math.min(x, y);
		x -= tmp;
		y -= tmp;
		if(a + b < 2 * c) {
			ans += tmp * (a + b);
		} else {
			ans += tmp * 2 * c;
		}
		if(x % 2 == 1) {
			if(a < 2 * c) {
				ans += a;
			} else {
				ans += 2 * c;
			}
			x--;
		}
		if(a < 2 * c) {
			ans += a * x;
		} else {
			ans += 2 * c * x;
		}
		if(y % 2 == 1) {
			if(b < 2 * c) {
				ans += b;
			} else {
				ans += 2 * c;
			}
			y--;
		}
		if(b < 2 * c) {
			ans += b * y;
		} else {
			ans += 2 * c * y;
		}
		System.out.println(ans);
	}

} 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();
		long ans = 0;
		int tmp = Math.min(x, y);
		x -= tmp;
		y -= tmp;
		if(a + b < 2 * c) {
			ans += tmp * (a + b);
		} else {
			ans += tmp * 2 * c;
		}
		if(x % 2 == 1) {
			if(a < 2 * c) {
				ans += a;
			} else {
				ans += 2 * c;
			}
			x--;
		}
		if(a < 2 * c) {
			ans += a * x;
		} else {
			ans += 2 * c * x;
		}
		if(y % 2 == 1) {
			if(b < 2 * c) {
				ans += b;
			} else {
				ans += 2 * c;
			}
			y--;
		}
		if(b < 2 * c) {
			ans += b * y;
		} else {
			ans += 2 * c * y;
		}
		System.out.println(ans);
	} 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();
		long ans = 0;
		int tmp = Math.min(x, y);
		x -= tmp;
		y -= tmp;
		if(a + b < 2 * c) {
			ans += tmp * (a + b);
		} else {
			ans += tmp * 2 * c;
		}
		if(x % 2 == 1) {
			if(a < 2 * c) {
				ans += a;
			} else {
				ans += 2 * c;
			}
			x--;
		}
		if(a < 2 * c) {
			ans += a * x;
		} else {
			ans += 2 * c * x;
		}
		if(y % 2 == 1) {
			if(b < 2 * c) {
				ans += b;
			} else {
				ans += 2 * c;
			}
			y--;
		}
		if(b < 2 * c) {
			ans += b * y;
		} else {
			ans += 2 * c * y;
		}
		System.out.println(ans);
	} 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 long ans = 0; ans 0 int tmp = Math.min(x, y); tmp Math.min(x, y) Math.min Math x y x -= tmp x tmp y -= tmp y tmp if(a + b < 2 * c) {
			ans += tmp * (a + b);
		} else {
			ans += tmp * 2 * c;
		} a + b < 2 * c a + b a b 2 * c 2 c {
			ans += tmp * (a + b);
		} ans += tmp * (a + b) ans tmp * (a + b) tmp (a + b) a b {
			ans += tmp * 2 * c;
		} ans += tmp * 2 * c ans tmp * 2 * c tmp * 2 * c tmp 2 c if(x % 2 == 1) {
			if(a < 2 * c) {
				ans += a;
			} else {
				ans += 2 * c;
			}
			x--;
		} x % 2 == 1 x % 2 x 2 1 {
			if(a < 2 * c) {
				ans += a;
			} else {
				ans += 2 * c;
			}
			x--;
		} if(a < 2 * c) {
				ans += a;
			} else {
				ans += 2 * c;
			} a < 2 * c a 2 * c 2 c {
				ans += a;
			} ans += a ans a {
				ans += 2 * c;
			} ans += 2 * c ans 2 * c 2 c x-- x if(a < 2 * c) {
			ans += a * x;
		} else {
			ans += 2 * c * x;
		} a < 2 * c a 2 * c 2 c {
			ans += a * x;
		} ans += a * x ans a * x a x {
			ans += 2 * c * x;
		} ans += 2 * c * x ans 2 * c * x 2 * c * x 2 c x if(y % 2 == 1) {
			if(b < 2 * c) {
				ans += b;
			} else {
				ans += 2 * c;
			}
			y--;
		} y % 2 == 1 y % 2 y 2 1 {
			if(b < 2 * c) {
				ans += b;
			} else {
				ans += 2 * c;
			}
			y--;
		} if(b < 2 * c) {
				ans += b;
			} else {
				ans += 2 * c;
			} b < 2 * c b 2 * c 2 c {
				ans += b;
			} ans += b ans b {
				ans += 2 * c;
			} ans += 2 * c ans 2 * c 2 c y-- y if(b < 2 * c) {
			ans += b * y;
		} else {
			ans += 2 * c * y;
		} b < 2 * c b 2 * c 2 c {
			ans += b * y;
		} ans += b * y ans b * y b y {
			ans += 2 * c * y;
		} ans += 2 * c * y ans 2 * c * y 2 * c * y 2 c y System.out.println(ans) System.out.println System.out System System.out ans String[] args args public 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();
		long ans = 0;
		int tmp = Math.min(x, y);
		x -= tmp;
		y -= tmp;
		if(a + b < 2 * c) {
			ans += tmp * (a + b);
		} else {
			ans += tmp * 2 * c;
		}
		if(x % 2 == 1) {
			if(a < 2 * c) {
				ans += a;
			} else {
				ans += 2 * c;
			}
			x--;
		}
		if(a < 2 * c) {
			ans += a * x;
		} else {
			ans += 2 * c * x;
		}
		if(y % 2 == 1) {
			if(b < 2 * c) {
				ans += b;
			} else {
				ans += 2 * c;
			}
			y--;
		}
		if(b < 2 * c) {
			ans += b * y;
		} else {
			ans += 2 * c * y;
		}
		System.out.println(ans);
	}

} public 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();
		long ans = 0;
		int tmp = Math.min(x, y);
		x -= tmp;
		y -= tmp;
		if(a + b < 2 * c) {
			ans += tmp * (a + b);
		} else {
			ans += tmp * 2 * c;
		}
		if(x % 2 == 1) {
			if(a < 2 * c) {
				ans += a;
			} else {
				ans += 2 * c;
			}
			x--;
		}
		if(a < 2 * c) {
			ans += a * x;
		} else {
			ans += 2 * c * x;
		}
		if(y % 2 == 1) {
			if(b < 2 * c) {
				ans += b;
			} else {
				ans += 2 * c;
			}
			y--;
		}
		if(b < 2 * c) {
			ans += b * y;
		} else {
			ans += 2 * c * y;
		}
		System.out.println(ans);
	}

} Main

import java.util.Scanner;

public 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();
		long ans = 0;
		int tmp = Math.min(x, y);
		x -= tmp;
		y -= tmp;
		if(a + b < 2 * c) {
			ans += tmp * (a + b);
		} else {
			ans += tmp * 2 * c;
		}
		if(x % 2 == 1) {
			if(a < 2 * c) {
				ans += a;
			} else {
				ans += 2 * c;
			}
			x--;
		}
		if(a < 2 * c) {
			ans += a * x;
		} else {
			ans += 2 * c * x;
		}
		if(y % 2 == 1) {
			if(b < 2 * c) {
				ans += b;
			} else {
				ans += 2 * c;
			}
			y--;
		}
		if(b < 2 * c) {
			ans += b * y;
		} else {
			ans += 2 * c * y;
		}
		System.out.println(ans);
	}

}
