let () = Scanf.scanf "%d %d %d %d %d" @@ fun a b c x y ->
  Array.init (max x y + 1) (fun i ->
    a * (max 0 (x - i)) + b * (max 0 (y - i)) + 2 * c * i)
  |> Array.fold_left min max_int
  |> Printf.printf "%d\n"
