(* O(max x y) *)
Scanf.scanf " %d %d %d %d %d" @@ fun a b c x y ->
  let ans = ref max_int in
  for i = 0 to max x y do
    let sum = ref @@ 2 * c * i in
    let x', y' = max 0 @@ x - i, max 0 @@ y - i in
    sum := !sum + a * x' + b * y';
    ans := min !ans !sum
  done;
  Printf.printf "%d\n" !ans