let () =
  let a, b, c, x, y = Scanf.scanf "%d %d %d %d %d\n" (fun a b c d e -> a, b, c, d, e) in

  let a1 =
    if x < y
    then c * 2 * x + b * (y - x)
    else c * 2 * y + a * (x - y)
  in
  let a2 = a * x + b * y in
  let a3 = c * 2 * (if x > y then x else y) in

  print_endline (string_of_int (min a1 (min a2 a3)))

