use std::io;

fn read_line()-> String {
    let mut s = String::new();
    let _ = io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

fn main() {
	let s = read_line().split_whitespace().map(|e|e.parse().unwrap())
	.collect::<Vec<i32>>();
	let ABC = &s[0..3];
	let X = s[3];
	let Y = s[4];

	let mut c = 0;

	if X > Y {
		c+=((X+Y)+X-Y);
	}else{
		c+=((Y+X)+Y-X);
	}

	if s[0] == s[1] && s[1] == s[2] {
		println!("{}",(X+Y)*s[0]);
	} else if &s[2] == ABC.iter().min().unwrap() {
		println!("{}",c*s[2]);
	}else{
		let m = (X+Y)%2;
		let mut AB = 0;
		if X > Y {
			AB+=(((X+Y)-m)*s[2]);
			AB+=(s[0]*m);
		}else{
			AB+=(((X+Y)-m)*s[2]);
			AB+=(s[1]*m);
		}

		let A = (s[0]*X)+(s[1]*Y);
		if A > AB {
			println!("{}",AB);
		}else{
			println!("{}",A);
		}

	}
}
