use std::cmp::{max,min};

fn solve(a: i32, b: i32, c: i32, x: i32, y: i32) -> i32 {
    let mut ans = 1<<29;
    for nc in 0..(max(2*x, 2*y)+1) {
        let rest_x = max(0, x - nc / 2);
        let rest_y = max(0, y - nc / 2);
        let price = a * rest_x + b * rest_y + c * nc;
        ans = min(ans, price);
    }
    ans
}

fn main() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    let mut iter = s.split_whitespace().map(|w| w.trim().parse().ok().unwrap());
    let a = iter.next().unwrap();
    let b = iter.next().unwrap();
    let c = iter.next().unwrap();
    let x = iter.next().unwrap();
    let y = iter.next().unwrap();
    let r = solve(a, b, c, x, y);
    println!("{}", r);
}
