import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long A = sc.nextLong();
		long B = sc.nextLong();
		long C = sc.nextLong();
		long X = sc.nextLong();
		long Y = sc.nextLong();
		
		long sum = 0;
		
		if(A + B >= 2 * C) {
			if(X >= Y) {
				sum = 2 * C * Y;
				if(A >= 2 * C) {
					sum += (X - Y) * 2 * C;
				} else {
					sum += (X - Y) * A;
				}
			} else {
				sum = 2 * C * X;
				if(B >= 2 * C) {
					sum += (Y - X) * 2 * C;
				} else {
					sum += (Y - X) * B;
				}
			}
		} else if(A + B < 2 * C) {
			sum = A * X + B * Y;
		}
		System.out.println(sum);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long A = sc.nextLong();
		long B = sc.nextLong();
		long C = sc.nextLong();
		long X = sc.nextLong();
		long Y = sc.nextLong();
		
		long sum = 0;
		
		if(A + B >= 2 * C) {
			if(X >= Y) {
				sum = 2 * C * Y;
				if(A >= 2 * C) {
					sum += (X - Y) * 2 * C;
				} else {
					sum += (X - Y) * A;
				}
			} else {
				sum = 2 * C * X;
				if(B >= 2 * C) {
					sum += (Y - X) * 2 * C;
				} else {
					sum += (Y - X) * B;
				}
			}
		} else if(A + B < 2 * C) {
			sum = A * X + B * Y;
		}
		System.out.println(sum);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long A = sc.nextLong();
		long B = sc.nextLong();
		long C = sc.nextLong();
		long X = sc.nextLong();
		long Y = sc.nextLong();
		
		long sum = 0;
		
		if(A + B >= 2 * C) {
			if(X >= Y) {
				sum = 2 * C * Y;
				if(A >= 2 * C) {
					sum += (X - Y) * 2 * C;
				} else {
					sum += (X - Y) * A;
				}
			} else {
				sum = 2 * C * X;
				if(B >= 2 * C) {
					sum += (Y - X) * 2 * C;
				} else {
					sum += (Y - X) * B;
				}
			}
		} else if(A + B < 2 * C) {
			sum = A * X + B * Y;
		}
		System.out.println(sum);
	} main {
		Scanner sc = new Scanner(System.in);
		long A = sc.nextLong();
		long B = sc.nextLong();
		long C = sc.nextLong();
		long X = sc.nextLong();
		long Y = sc.nextLong();
		
		long sum = 0;
		
		if(A + B >= 2 * C) {
			if(X >= Y) {
				sum = 2 * C * Y;
				if(A >= 2 * C) {
					sum += (X - Y) * 2 * C;
				} else {
					sum += (X - Y) * A;
				}
			} else {
				sum = 2 * C * X;
				if(B >= 2 * C) {
					sum += (Y - X) * 2 * C;
				} else {
					sum += (Y - X) * B;
				}
			}
		} else if(A + B < 2 * C) {
			sum = A * X + B * Y;
		}
		System.out.println(sum);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long A = sc.nextLong(); A sc.nextLong() sc.nextLong sc long B = sc.nextLong(); B sc.nextLong() sc.nextLong sc long C = sc.nextLong(); C sc.nextLong() sc.nextLong sc long X = sc.nextLong(); X sc.nextLong() sc.nextLong sc long Y = sc.nextLong(); Y sc.nextLong() sc.nextLong sc long sum = 0; sum 0 if(A + B >= 2 * C) {
			if(X >= Y) {
				sum = 2 * C * Y;
				if(A >= 2 * C) {
					sum += (X - Y) * 2 * C;
				} else {
					sum += (X - Y) * A;
				}
			} else {
				sum = 2 * C * X;
				if(B >= 2 * C) {
					sum += (Y - X) * 2 * C;
				} else {
					sum += (Y - X) * B;
				}
			}
		} else if(A + B < 2 * C) {
			sum = A * X + B * Y;
		} A + B >= 2 * C A + B A B 2 * C 2 C {
			if(X >= Y) {
				sum = 2 * C * Y;
				if(A >= 2 * C) {
					sum += (X - Y) * 2 * C;
				} else {
					sum += (X - Y) * A;
				}
			} else {
				sum = 2 * C * X;
				if(B >= 2 * C) {
					sum += (Y - X) * 2 * C;
				} else {
					sum += (Y - X) * B;
				}
			}
		} if(X >= Y) {
				sum = 2 * C * Y;
				if(A >= 2 * C) {
					sum += (X - Y) * 2 * C;
				} else {
					sum += (X - Y) * A;
				}
			} else {
				sum = 2 * C * X;
				if(B >= 2 * C) {
					sum += (Y - X) * 2 * C;
				} else {
					sum += (Y - X) * B;
				}
			} X >= Y X Y {
				sum = 2 * C * Y;
				if(A >= 2 * C) {
					sum += (X - Y) * 2 * C;
				} else {
					sum += (X - Y) * A;
				}
			} sum = 2 * C * Y sum 2 * C * Y 2 * C * Y 2 C Y if(A >= 2 * C) {
					sum += (X - Y) * 2 * C;
				} else {
					sum += (X - Y) * A;
				} A >= 2 * C A 2 * C 2 C {
					sum += (X - Y) * 2 * C;
				} sum += (X - Y) * 2 * C sum (X - Y) * 2 * C (X - Y) * 2 * C (X - Y) X Y 2 C {
					sum += (X - Y) * A;
				} sum += (X - Y) * A sum (X - Y) * A (X - Y) X Y A {
				sum = 2 * C * X;
				if(B >= 2 * C) {
					sum += (Y - X) * 2 * C;
				} else {
					sum += (Y - X) * B;
				}
			} sum = 2 * C * X sum 2 * C * X 2 * C * X 2 C X if(B >= 2 * C) {
					sum += (Y - X) * 2 * C;
				} else {
					sum += (Y - X) * B;
				} B >= 2 * C B 2 * C 2 C {
					sum += (Y - X) * 2 * C;
				} sum += (Y - X) * 2 * C sum (Y - X) * 2 * C (Y - X) * 2 * C (Y - X) Y X 2 C {
					sum += (Y - X) * B;
				} sum += (Y - X) * B sum (Y - X) * B (Y - X) Y X B if(A + B < 2 * C) {
			sum = A * X + B * Y;
		} A + B < 2 * C A + B A B 2 * C 2 C {
			sum = A * X + B * Y;
		} sum = A * X + B * Y sum A * X + B * Y A * X A X B * Y B Y System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long A = sc.nextLong();
		long B = sc.nextLong();
		long C = sc.nextLong();
		long X = sc.nextLong();
		long Y = sc.nextLong();
		
		long sum = 0;
		
		if(A + B >= 2 * C) {
			if(X >= Y) {
				sum = 2 * C * Y;
				if(A >= 2 * C) {
					sum += (X - Y) * 2 * C;
				} else {
					sum += (X - Y) * A;
				}
			} else {
				sum = 2 * C * X;
				if(B >= 2 * C) {
					sum += (Y - X) * 2 * C;
				} else {
					sum += (Y - X) * B;
				}
			}
		} else if(A + B < 2 * C) {
			sum = A * X + B * Y;
		}
		System.out.println(sum);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long A = sc.nextLong();
		long B = sc.nextLong();
		long C = sc.nextLong();
		long X = sc.nextLong();
		long Y = sc.nextLong();
		
		long sum = 0;
		
		if(A + B >= 2 * C) {
			if(X >= Y) {
				sum = 2 * C * Y;
				if(A >= 2 * C) {
					sum += (X - Y) * 2 * C;
				} else {
					sum += (X - Y) * A;
				}
			} else {
				sum = 2 * C * X;
				if(B >= 2 * C) {
					sum += (Y - X) * 2 * C;
				} else {
					sum += (Y - X) * B;
				}
			}
		} else if(A + B < 2 * C) {
			sum = A * X + B * Y;
		}
		System.out.println(sum);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long A = sc.nextLong();
		long B = sc.nextLong();
		long C = sc.nextLong();
		long X = sc.nextLong();
		long Y = sc.nextLong();
		
		long sum = 0;
		
		if(A + B >= 2 * C) {
			if(X >= Y) {
				sum = 2 * C * Y;
				if(A >= 2 * C) {
					sum += (X - Y) * 2 * C;
				} else {
					sum += (X - Y) * A;
				}
			} else {
				sum = 2 * C * X;
				if(B >= 2 * C) {
					sum += (Y - X) * 2 * C;
				} else {
					sum += (Y - X) * B;
				}
			}
		} else if(A + B < 2 * C) {
			sum = A * X + B * Y;
		}
		System.out.println(sum);
	}
}
