let a, b, c, x, y = Scanf.scanf " %d %d %d %d %d" @@ fun a b c d e -> a, b, c, d, e
let r, z = if x > y then x - y, a else y - x, b
let _ = Printf.printf "%d\n" @@ min x y * min (a + b) (2 * c) + r * min z (2 * c)