import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = Integer.parseInt(sc.next());
		int B = Integer.parseInt(sc.next());
		int C = Integer.parseInt(sc.next());
		int X = Integer.parseInt(sc.next());
		int Y = Integer.parseInt(sc.next());
		sc.close();

		int cost = 0;
		if(A + B < 2 * C) {
			if(X > Y) {
				cost = (A + B) * Y + A * (X - Y);
			}else if(X < Y) {
				cost = (A + B) * X+ B * (Y - X);
			}else {
				cost = (A + B) * X;
			}
		}else if(A + B > 2 * C){
			if(X > Y) {
				if(A <= 2 * C) {
					cost = 2 * C * Y + A * (X - Y);
				}else {
					cost = 2 * C * Y + 2 * C * (X - Y);
				}
			}else if(X < Y) {
				if(B <= 2 * C) {
					cost = 2 * C * X + B * (Y - X);
				}else {
					cost = 2 * C * X + 2 * C * (Y - X);
				}
			}else {
				cost = 2 * C * X;
			}
		}else {
			if(X > Y) {
				if(A <= 2 * C) {
					cost = 2 * C * Y + A * (X - Y);
				}else {
					cost = 2 * C * Y + 2 * C * (X - Y);
				}
			}else if(X < Y) {
				if(B <= 2 * C) {
					cost = 2 * C * X + B * (Y - X);
				}else {
					cost = 2 * C * X + 2 * C * (Y - X);
				}
			}else {
				cost = 2 * C * X;
			}
		}
		System.out.println(cost);
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = Integer.parseInt(sc.next());
		int B = Integer.parseInt(sc.next());
		int C = Integer.parseInt(sc.next());
		int X = Integer.parseInt(sc.next());
		int Y = Integer.parseInt(sc.next());
		sc.close();

		int cost = 0;
		if(A + B < 2 * C) {
			if(X > Y) {
				cost = (A + B) * Y + A * (X - Y);
			}else if(X < Y) {
				cost = (A + B) * X+ B * (Y - X);
			}else {
				cost = (A + B) * X;
			}
		}else if(A + B > 2 * C){
			if(X > Y) {
				if(A <= 2 * C) {
					cost = 2 * C * Y + A * (X - Y);
				}else {
					cost = 2 * C * Y + 2 * C * (X - Y);
				}
			}else if(X < Y) {
				if(B <= 2 * C) {
					cost = 2 * C * X + B * (Y - X);
				}else {
					cost = 2 * C * X + 2 * C * (Y - X);
				}
			}else {
				cost = 2 * C * X;
			}
		}else {
			if(X > Y) {
				if(A <= 2 * C) {
					cost = 2 * C * Y + A * (X - Y);
				}else {
					cost = 2 * C * Y + 2 * C * (X - Y);
				}
			}else if(X < Y) {
				if(B <= 2 * C) {
					cost = 2 * C * X + B * (Y - X);
				}else {
					cost = 2 * C * X + 2 * C * (Y - X);
				}
			}else {
				cost = 2 * C * X;
			}
		}
		System.out.println(cost);
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = Integer.parseInt(sc.next());
		int B = Integer.parseInt(sc.next());
		int C = Integer.parseInt(sc.next());
		int X = Integer.parseInt(sc.next());
		int Y = Integer.parseInt(sc.next());
		sc.close();

		int cost = 0;
		if(A + B < 2 * C) {
			if(X > Y) {
				cost = (A + B) * Y + A * (X - Y);
			}else if(X < Y) {
				cost = (A + B) * X+ B * (Y - X);
			}else {
				cost = (A + B) * X;
			}
		}else if(A + B > 2 * C){
			if(X > Y) {
				if(A <= 2 * C) {
					cost = 2 * C * Y + A * (X - Y);
				}else {
					cost = 2 * C * Y + 2 * C * (X - Y);
				}
			}else if(X < Y) {
				if(B <= 2 * C) {
					cost = 2 * C * X + B * (Y - X);
				}else {
					cost = 2 * C * X + 2 * C * (Y - X);
				}
			}else {
				cost = 2 * C * X;
			}
		}else {
			if(X > Y) {
				if(A <= 2 * C) {
					cost = 2 * C * Y + A * (X - Y);
				}else {
					cost = 2 * C * Y + 2 * C * (X - Y);
				}
			}else if(X < Y) {
				if(B <= 2 * C) {
					cost = 2 * C * X + B * (Y - X);
				}else {
					cost = 2 * C * X + 2 * C * (Y - X);
				}
			}else {
				cost = 2 * C * X;
			}
		}
		System.out.println(cost);
	} main {
		Scanner sc = new Scanner(System.in);
		int A = Integer.parseInt(sc.next());
		int B = Integer.parseInt(sc.next());
		int C = Integer.parseInt(sc.next());
		int X = Integer.parseInt(sc.next());
		int Y = Integer.parseInt(sc.next());
		sc.close();

		int cost = 0;
		if(A + B < 2 * C) {
			if(X > Y) {
				cost = (A + B) * Y + A * (X - Y);
			}else if(X < Y) {
				cost = (A + B) * X+ B * (Y - X);
			}else {
				cost = (A + B) * X;
			}
		}else if(A + B > 2 * C){
			if(X > Y) {
				if(A <= 2 * C) {
					cost = 2 * C * Y + A * (X - Y);
				}else {
					cost = 2 * C * Y + 2 * C * (X - Y);
				}
			}else if(X < Y) {
				if(B <= 2 * C) {
					cost = 2 * C * X + B * (Y - X);
				}else {
					cost = 2 * C * X + 2 * C * (Y - X);
				}
			}else {
				cost = 2 * C * X;
			}
		}else {
			if(X > Y) {
				if(A <= 2 * C) {
					cost = 2 * C * Y + A * (X - Y);
				}else {
					cost = 2 * C * Y + 2 * C * (X - Y);
				}
			}else if(X < Y) {
				if(B <= 2 * C) {
					cost = 2 * C * X + B * (Y - X);
				}else {
					cost = 2 * C * X + 2 * C * (Y - X);
				}
			}else {
				cost = 2 * C * X;
			}
		}
		System.out.println(cost);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A = Integer.parseInt(sc.next()); A Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int B = Integer.parseInt(sc.next()); B Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int C = Integer.parseInt(sc.next()); C Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int X = Integer.parseInt(sc.next()); X Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int Y = Integer.parseInt(sc.next()); Y Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc sc.close() sc.close sc int cost = 0; cost 0 if(A + B < 2 * C) {
			if(X > Y) {
				cost = (A + B) * Y + A * (X - Y);
			}else if(X < Y) {
				cost = (A + B) * X+ B * (Y - X);
			}else {
				cost = (A + B) * X;
			}
		}else if(A + B > 2 * C){
			if(X > Y) {
				if(A <= 2 * C) {
					cost = 2 * C * Y + A * (X - Y);
				}else {
					cost = 2 * C * Y + 2 * C * (X - Y);
				}
			}else if(X < Y) {
				if(B <= 2 * C) {
					cost = 2 * C * X + B * (Y - X);
				}else {
					cost = 2 * C * X + 2 * C * (Y - X);
				}
			}else {
				cost = 2 * C * X;
			}
		}else {
			if(X > Y) {
				if(A <= 2 * C) {
					cost = 2 * C * Y + A * (X - Y);
				}else {
					cost = 2 * C * Y + 2 * C * (X - Y);
				}
			}else if(X < Y) {
				if(B <= 2 * C) {
					cost = 2 * C * X + B * (Y - X);
				}else {
					cost = 2 * C * X + 2 * C * (Y - X);
				}
			}else {
				cost = 2 * C * X;
			}
		} A + B < 2 * C A + B A B 2 * C 2 C {
			if(X > Y) {
				cost = (A + B) * Y + A * (X - Y);
			}else if(X < Y) {
				cost = (A + B) * X+ B * (Y - X);
			}else {
				cost = (A + B) * X;
			}
		} if(X > Y) {
				cost = (A + B) * Y + A * (X - Y);
			}else if(X < Y) {
				cost = (A + B) * X+ B * (Y - X);
			}else {
				cost = (A + B) * X;
			} X > Y X Y {
				cost = (A + B) * Y + A * (X - Y);
			} cost = (A + B) * Y + A * (X - Y) cost (A + B) * Y + A * (X - Y) (A + B) * Y (A + B) A B Y A * (X - Y) A (X - Y) X Y if(X < Y) {
				cost = (A + B) * X+ B * (Y - X);
			}else {
				cost = (A + B) * X;
			} X < Y X Y {
				cost = (A + B) * X+ B * (Y - X);
			} cost = (A + B) * X+ B * (Y - X) cost (A + B) * X+ B * (Y - X) (A + B) * X (A + B) A B X B * (Y - X) B (Y - X) Y X {
				cost = (A + B) * X;
			} cost = (A + B) * X cost (A + B) * X (A + B) A B X if(A + B > 2 * C){
			if(X > Y) {
				if(A <= 2 * C) {
					cost = 2 * C * Y + A * (X - Y);
				}else {
					cost = 2 * C * Y + 2 * C * (X - Y);
				}
			}else if(X < Y) {
				if(B <= 2 * C) {
					cost = 2 * C * X + B * (Y - X);
				}else {
					cost = 2 * C * X + 2 * C * (Y - X);
				}
			}else {
				cost = 2 * C * X;
			}
		}else {
			if(X > Y) {
				if(A <= 2 * C) {
					cost = 2 * C * Y + A * (X - Y);
				}else {
					cost = 2 * C * Y + 2 * C * (X - Y);
				}
			}else if(X < Y) {
				if(B <= 2 * C) {
					cost = 2 * C * X + B * (Y - X);
				}else {
					cost = 2 * C * X + 2 * C * (Y - X);
				}
			}else {
				cost = 2 * C * X;
			}
		} A + B > 2 * C A + B A B 2 * C 2 C {
			if(X > Y) {
				if(A <= 2 * C) {
					cost = 2 * C * Y + A * (X - Y);
				}else {
					cost = 2 * C * Y + 2 * C * (X - Y);
				}
			}else if(X < Y) {
				if(B <= 2 * C) {
					cost = 2 * C * X + B * (Y - X);
				}else {
					cost = 2 * C * X + 2 * C * (Y - X);
				}
			}else {
				cost = 2 * C * X;
			}
		} if(X > Y) {
				if(A <= 2 * C) {
					cost = 2 * C * Y + A * (X - Y);
				}else {
					cost = 2 * C * Y + 2 * C * (X - Y);
				}
			}else if(X < Y) {
				if(B <= 2 * C) {
					cost = 2 * C * X + B * (Y - X);
				}else {
					cost = 2 * C * X + 2 * C * (Y - X);
				}
			}else {
				cost = 2 * C * X;
			} X > Y X Y {
				if(A <= 2 * C) {
					cost = 2 * C * Y + A * (X - Y);
				}else {
					cost = 2 * C * Y + 2 * C * (X - Y);
				}
			} if(A <= 2 * C) {
					cost = 2 * C * Y + A * (X - Y);
				}else {
					cost = 2 * C * Y + 2 * C * (X - Y);
				} A <= 2 * C A 2 * C 2 C {
					cost = 2 * C * Y + A * (X - Y);
				} cost = 2 * C * Y + A * (X - Y) cost 2 * C * Y + A * (X - Y) 2 * C * Y 2 * C * Y 2 C Y A * (X - Y) A (X - Y) X Y {
					cost = 2 * C * Y + 2 * C * (X - Y);
				} cost = 2 * C * Y + 2 * C * (X - Y) cost 2 * C * Y + 2 * C * (X - Y) 2 * C * Y 2 * C * Y 2 C Y 2 * C * (X - Y) 2 * C * (X - Y) 2 C (X - Y) X Y if(X < Y) {
				if(B <= 2 * C) {
					cost = 2 * C * X + B * (Y - X);
				}else {
					cost = 2 * C * X + 2 * C * (Y - X);
				}
			}else {
				cost = 2 * C * X;
			} X < Y X Y {
				if(B <= 2 * C) {
					cost = 2 * C * X + B * (Y - X);
				}else {
					cost = 2 * C * X + 2 * C * (Y - X);
				}
			} if(B <= 2 * C) {
					cost = 2 * C * X + B * (Y - X);
				}else {
					cost = 2 * C * X + 2 * C * (Y - X);
				} B <= 2 * C B 2 * C 2 C {
					cost = 2 * C * X + B * (Y - X);
				} cost = 2 * C * X + B * (Y - X) cost 2 * C * X + B * (Y - X) 2 * C * X 2 * C * X 2 C X B * (Y - X) B (Y - X) Y X {
					cost = 2 * C * X + 2 * C * (Y - X);
				} cost = 2 * C * X + 2 * C * (Y - X) cost 2 * C * X + 2 * C * (Y - X) 2 * C * X 2 * C * X 2 C X 2 * C * (Y - X) 2 * C * (Y - X) 2 C (Y - X) Y X {
				cost = 2 * C * X;
			} cost = 2 * C * X cost 2 * C * X 2 * C * X 2 C X {
			if(X > Y) {
				if(A <= 2 * C) {
					cost = 2 * C * Y + A * (X - Y);
				}else {
					cost = 2 * C * Y + 2 * C * (X - Y);
				}
			}else if(X < Y) {
				if(B <= 2 * C) {
					cost = 2 * C * X + B * (Y - X);
				}else {
					cost = 2 * C * X + 2 * C * (Y - X);
				}
			}else {
				cost = 2 * C * X;
			}
		} if(X > Y) {
				if(A <= 2 * C) {
					cost = 2 * C * Y + A * (X - Y);
				}else {
					cost = 2 * C * Y + 2 * C * (X - Y);
				}
			}else if(X < Y) {
				if(B <= 2 * C) {
					cost = 2 * C * X + B * (Y - X);
				}else {
					cost = 2 * C * X + 2 * C * (Y - X);
				}
			}else {
				cost = 2 * C * X;
			} X > Y X Y {
				if(A <= 2 * C) {
					cost = 2 * C * Y + A * (X - Y);
				}else {
					cost = 2 * C * Y + 2 * C * (X - Y);
				}
			} if(A <= 2 * C) {
					cost = 2 * C * Y + A * (X - Y);
				}else {
					cost = 2 * C * Y + 2 * C * (X - Y);
				} A <= 2 * C A 2 * C 2 C {
					cost = 2 * C * Y + A * (X - Y);
				} cost = 2 * C * Y + A * (X - Y) cost 2 * C * Y + A * (X - Y) 2 * C * Y 2 * C * Y 2 C Y A * (X - Y) A (X - Y) X Y {
					cost = 2 * C * Y + 2 * C * (X - Y);
				} cost = 2 * C * Y + 2 * C * (X - Y) cost 2 * C * Y + 2 * C * (X - Y) 2 * C * Y 2 * C * Y 2 C Y 2 * C * (X - Y) 2 * C * (X - Y) 2 C (X - Y) X Y if(X < Y) {
				if(B <= 2 * C) {
					cost = 2 * C * X + B * (Y - X);
				}else {
					cost = 2 * C * X + 2 * C * (Y - X);
				}
			}else {
				cost = 2 * C * X;
			} X < Y X Y {
				if(B <= 2 * C) {
					cost = 2 * C * X + B * (Y - X);
				}else {
					cost = 2 * C * X + 2 * C * (Y - X);
				}
			} if(B <= 2 * C) {
					cost = 2 * C * X + B * (Y - X);
				}else {
					cost = 2 * C * X + 2 * C * (Y - X);
				} B <= 2 * C B 2 * C 2 C {
					cost = 2 * C * X + B * (Y - X);
				} cost = 2 * C * X + B * (Y - X) cost 2 * C * X + B * (Y - X) 2 * C * X 2 * C * X 2 C X B * (Y - X) B (Y - X) Y X {
					cost = 2 * C * X + 2 * C * (Y - X);
				} cost = 2 * C * X + 2 * C * (Y - X) cost 2 * C * X + 2 * C * (Y - X) 2 * C * X 2 * C * X 2 C X 2 * C * (Y - X) 2 * C * (Y - X) 2 C (Y - X) Y X {
				cost = 2 * C * X;
			} cost = 2 * C * X cost 2 * C * X 2 * C * X 2 C X System.out.println(cost) System.out.println System.out System System.out cost String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = Integer.parseInt(sc.next());
		int B = Integer.parseInt(sc.next());
		int C = Integer.parseInt(sc.next());
		int X = Integer.parseInt(sc.next());
		int Y = Integer.parseInt(sc.next());
		sc.close();

		int cost = 0;
		if(A + B < 2 * C) {
			if(X > Y) {
				cost = (A + B) * Y + A * (X - Y);
			}else if(X < Y) {
				cost = (A + B) * X+ B * (Y - X);
			}else {
				cost = (A + B) * X;
			}
		}else if(A + B > 2 * C){
			if(X > Y) {
				if(A <= 2 * C) {
					cost = 2 * C * Y + A * (X - Y);
				}else {
					cost = 2 * C * Y + 2 * C * (X - Y);
				}
			}else if(X < Y) {
				if(B <= 2 * C) {
					cost = 2 * C * X + B * (Y - X);
				}else {
					cost = 2 * C * X + 2 * C * (Y - X);
				}
			}else {
				cost = 2 * C * X;
			}
		}else {
			if(X > Y) {
				if(A <= 2 * C) {
					cost = 2 * C * Y + A * (X - Y);
				}else {
					cost = 2 * C * Y + 2 * C * (X - Y);
				}
			}else if(X < Y) {
				if(B <= 2 * C) {
					cost = 2 * C * X + B * (Y - X);
				}else {
					cost = 2 * C * X + 2 * C * (Y - X);
				}
			}else {
				cost = 2 * C * X;
			}
		}
		System.out.println(cost);
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = Integer.parseInt(sc.next());
		int B = Integer.parseInt(sc.next());
		int C = Integer.parseInt(sc.next());
		int X = Integer.parseInt(sc.next());
		int Y = Integer.parseInt(sc.next());
		sc.close();

		int cost = 0;
		if(A + B < 2 * C) {
			if(X > Y) {
				cost = (A + B) * Y + A * (X - Y);
			}else if(X < Y) {
				cost = (A + B) * X+ B * (Y - X);
			}else {
				cost = (A + B) * X;
			}
		}else if(A + B > 2 * C){
			if(X > Y) {
				if(A <= 2 * C) {
					cost = 2 * C * Y + A * (X - Y);
				}else {
					cost = 2 * C * Y + 2 * C * (X - Y);
				}
			}else if(X < Y) {
				if(B <= 2 * C) {
					cost = 2 * C * X + B * (Y - X);
				}else {
					cost = 2 * C * X + 2 * C * (Y - X);
				}
			}else {
				cost = 2 * C * X;
			}
		}else {
			if(X > Y) {
				if(A <= 2 * C) {
					cost = 2 * C * Y + A * (X - Y);
				}else {
					cost = 2 * C * Y + 2 * C * (X - Y);
				}
			}else if(X < Y) {
				if(B <= 2 * C) {
					cost = 2 * C * X + B * (Y - X);
				}else {
					cost = 2 * C * X + 2 * C * (Y - X);
				}
			}else {
				cost = 2 * C * X;
			}
		}
		System.out.println(cost);
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = Integer.parseInt(sc.next());
		int B = Integer.parseInt(sc.next());
		int C = Integer.parseInt(sc.next());
		int X = Integer.parseInt(sc.next());
		int Y = Integer.parseInt(sc.next());
		sc.close();

		int cost = 0;
		if(A + B < 2 * C) {
			if(X > Y) {
				cost = (A + B) * Y + A * (X - Y);
			}else if(X < Y) {
				cost = (A + B) * X+ B * (Y - X);
			}else {
				cost = (A + B) * X;
			}
		}else if(A + B > 2 * C){
			if(X > Y) {
				if(A <= 2 * C) {
					cost = 2 * C * Y + A * (X - Y);
				}else {
					cost = 2 * C * Y + 2 * C * (X - Y);
				}
			}else if(X < Y) {
				if(B <= 2 * C) {
					cost = 2 * C * X + B * (Y - X);
				}else {
					cost = 2 * C * X + 2 * C * (Y - X);
				}
			}else {
				cost = 2 * C * X;
			}
		}else {
			if(X > Y) {
				if(A <= 2 * C) {
					cost = 2 * C * Y + A * (X - Y);
				}else {
					cost = 2 * C * Y + 2 * C * (X - Y);
				}
			}else if(X < Y) {
				if(B <= 2 * C) {
					cost = 2 * C * X + B * (Y - X);
				}else {
					cost = 2 * C * X + 2 * C * (Y - X);
				}
			}else {
				cost = 2 * C * X;
			}
		}
		System.out.println(cost);
	}

}