use std::io::{stdin, Read, StdinLock};
use std::str::FromStr;

#[allow(dead_code)]
struct Scanner<'a> {
    cin: StdinLock<'a>,
}
#[allow(dead_code)]
impl<'a> Scanner<'a> {
    fn new(cin: StdinLock<'a>) -> Scanner<'a> {
        Scanner { cin: cin }
    }

    fn read<T: FromStr>(&mut self) -> Option<T> {
        let token = self.cin.by_ref().bytes().map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        token.parse::<T>().ok()
    }

    fn input<T: FromStr>(&mut self) -> T {
        self.read().unwrap()
    }
}

fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin);
    let (a, b, c, x, y): (i64, i64, i64, i64, i64) =
        (sc.input(), sc.input(), sc.input(), sc.input(), sc.input());

    let mut ans = 10_000_000;
    for z in 0..std::cmp::max(x * 2, y * 2) {
        let anum = x - z;
        let bnum = y - z;
        if anum >= 0 && bnum >= 0 {
            let value = anum * a + bnum * b + z * c * 2;
            ans = std::cmp::min(ans, value);
        }
    }
    println!("{}", ans);
}
