(let ((a (read))
    (b (read))
    (c (read))
    (x (read))
    (y (read))
    (ans 0))

    (loop for i from 0 to (min x y) do
        (let ((ab_count (* 2 i))
            (a_count (- x i))
            (b_count (- y i))
            (tmp 0))
            (if (< a_count 0) (setq a_count 0))
            (if (< b_count 0) (setq b_count 0))
            (setq tmp (+ (* a a_count) (* b b_count) (* c ab_count)))
            (if (or (= ans 0) (> ans tmp))
                (setq ans tmp)
            )
        )
    )
    (princ ans)
)