let a, b, c, x, y = Scanf.sscanf (read_line ()) "%d %d %d %d %d" @@ fun a b c x y -> (a, b, c, x, y)

let buy_a n = if c * 2 < a then n * c * 2 else n * a
let buy_b n = if c * 2 < b then n * c * 2 else n * b

let () = Printf.printf "%d\n" @@
  if a + b >= c * 2 then 
    2 * c * (min x y) + if x > y then buy_a (x - y) else buy_b (y - x)
  else buy_a x + buy_b y