use proconio::{input, fastout};

#[fastout]
fn main() {
    input!{
        a: usize,
        b: usize,
        c: usize,
        x: usize,
        y: usize
    }
    let mut min_price = 5000 * 100_000;
    let ab_max = x.max(y);
    for i in 0..=ab_max {
        // a と b が i 枚ずつ
        let c_num = i * 2;
        let a_num = if x >= i {
            x - i
        } else {
            0
        };
        let b_num = if y >= i {
            y - i
        } else {
            0
        };
        let price = a_num * a + b_num * b + c_num * c;
        if min_price > price {
            min_price = price;
        }
    }
    println!("{}", min_price);
}
