use std::cmp::Ordering;
use whiteread::parse_line;

fn main() {
    let (a, b, c, x, y): (u32, u32, u32, u32, u32) = parse_line().unwrap();
    let ans;

    if c < (a + b) / 2 {
        match x.cmp(&y) {
            Ordering::Equal => ans = 2 * c * x,
            Ordering::Greater => ans = 2 * c * y + (a * (x - y)).min(2 * c * (x - y)),
            Ordering::Less => ans = 2 * c * x + (a * (y - x)).min(2 * c * (y - x)),
        }
    } else {
        ans = a * x + b * y;
    }
    println!("{}", ans);
}
