
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt()*2;
		int X = sc.nextInt();
		int Y = sc.nextInt();
		
		if(A+B>=C) {
			if(A!=0&&B!=0) {
				int minxy = min(X,Y);
				int numc = C*minxy;
				int sum = numc + A*(X-minxy) + B*(Y-minxy);
				
				int sum2 = C*max(X,Y);
				
				System.out.println(min(sum,sum2));
			}
			if(A==0||B==0) {
				System.out.println(A*X + B*Y);
			}
		}else {
			System.out.println(A*X + B*Y);
		}
		
	}

	public static int min(int a,int b) {
		return a<b?a:b;
	}
	
	public static int max(int a,int b) {
		return a>b?a:b;
	}
	
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt()*2;
		int X = sc.nextInt();
		int Y = sc.nextInt();
		
		if(A+B>=C) {
			if(A!=0&&B!=0) {
				int minxy = min(X,Y);
				int numc = C*minxy;
				int sum = numc + A*(X-minxy) + B*(Y-minxy);
				
				int sum2 = C*max(X,Y);
				
				System.out.println(min(sum,sum2));
			}
			if(A==0||B==0) {
				System.out.println(A*X + B*Y);
			}
		}else {
			System.out.println(A*X + B*Y);
		}
		
	}

	public static int min(int a,int b) {
		return a<b?a:b;
	}
	
	public static int max(int a,int b) {
		return a>b?a:b;
	}
	
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt()*2;
		int X = sc.nextInt();
		int Y = sc.nextInt();
		
		if(A+B>=C) {
			if(A!=0&&B!=0) {
				int minxy = min(X,Y);
				int numc = C*minxy;
				int sum = numc + A*(X-minxy) + B*(Y-minxy);
				
				int sum2 = C*max(X,Y);
				
				System.out.println(min(sum,sum2));
			}
			if(A==0||B==0) {
				System.out.println(A*X + B*Y);
			}
		}else {
			System.out.println(A*X + B*Y);
		}
		
	} main {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt()*2;
		int X = sc.nextInt();
		int Y = sc.nextInt();
		
		if(A+B>=C) {
			if(A!=0&&B!=0) {
				int minxy = min(X,Y);
				int numc = C*minxy;
				int sum = numc + A*(X-minxy) + B*(Y-minxy);
				
				int sum2 = C*max(X,Y);
				
				System.out.println(min(sum,sum2));
			}
			if(A==0||B==0) {
				System.out.println(A*X + B*Y);
			}
		}else {
			System.out.println(A*X + B*Y);
		}
		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A = sc.nextInt(); A sc.nextInt() sc.nextInt sc int B = sc.nextInt(); B sc.nextInt() sc.nextInt sc int C = sc.nextInt()*2; C sc.nextInt()*2 sc.nextInt() sc.nextInt sc 2 int X = sc.nextInt(); X sc.nextInt() sc.nextInt sc int Y = sc.nextInt(); Y sc.nextInt() sc.nextInt sc if(A+B>=C) {
			if(A!=0&&B!=0) {
				int minxy = min(X,Y);
				int numc = C*minxy;
				int sum = numc + A*(X-minxy) + B*(Y-minxy);
				
				int sum2 = C*max(X,Y);
				
				System.out.println(min(sum,sum2));
			}
			if(A==0||B==0) {
				System.out.println(A*X + B*Y);
			}
		}else {
			System.out.println(A*X + B*Y);
		} A+B>=C A+B A B C {
			if(A!=0&&B!=0) {
				int minxy = min(X,Y);
				int numc = C*minxy;
				int sum = numc + A*(X-minxy) + B*(Y-minxy);
				
				int sum2 = C*max(X,Y);
				
				System.out.println(min(sum,sum2));
			}
			if(A==0||B==0) {
				System.out.println(A*X + B*Y);
			}
		} if(A!=0&&B!=0) {
				int minxy = min(X,Y);
				int numc = C*minxy;
				int sum = numc + A*(X-minxy) + B*(Y-minxy);
				
				int sum2 = C*max(X,Y);
				
				System.out.println(min(sum,sum2));
			} A!=0&&B!=0 A!=0 A 0 B!=0 B 0 {
				int minxy = min(X,Y);
				int numc = C*minxy;
				int sum = numc + A*(X-minxy) + B*(Y-minxy);
				
				int sum2 = C*max(X,Y);
				
				System.out.println(min(sum,sum2));
			} int minxy = min(X,Y); minxy min(X,Y) min X Y int numc = C*minxy; numc C*minxy C minxy int sum = numc + A*(X-minxy) + B*(Y-minxy); sum numc + A*(X-minxy) + B*(Y-minxy) numc + A*(X-minxy) + B*(Y-minxy) numc A*(X-minxy) A (X-minxy) X minxy B*(Y-minxy) B (Y-minxy) Y minxy int sum2 = C*max(X,Y); sum2 C*max(X,Y) C max(X,Y) max X Y System.out.println(min(sum,sum2)) System.out.println System.out System System.out min(sum,sum2) min sum sum2 if(A==0||B==0) {
				System.out.println(A*X + B*Y);
			} A==0||B==0 A==0 A 0 B==0 B 0 {
				System.out.println(A*X + B*Y);
			} System.out.println(A*X + B*Y) System.out.println System.out System System.out A*X + B*Y A*X A X B*Y B Y {
			System.out.println(A*X + B*Y);
		} System.out.println(A*X + B*Y) System.out.println System.out System System.out A*X + B*Y A*X A X B*Y B Y String[] args args public static int min(int a,int b) {
		return a<b?a:b;
	} min {
		return a<b?a:b;
	} return a<b?a:b; a<b?a:b a<b a b a b int a a int b b public static int max(int a,int b) {
		return a>b?a:b;
	} max {
		return a>b?a:b;
	} return a>b?a:b; a>b?a:b a>b a b a b int a a int b b public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt()*2;
		int X = sc.nextInt();
		int Y = sc.nextInt();
		
		if(A+B>=C) {
			if(A!=0&&B!=0) {
				int minxy = min(X,Y);
				int numc = C*minxy;
				int sum = numc + A*(X-minxy) + B*(Y-minxy);
				
				int sum2 = C*max(X,Y);
				
				System.out.println(min(sum,sum2));
			}
			if(A==0||B==0) {
				System.out.println(A*X + B*Y);
			}
		}else {
			System.out.println(A*X + B*Y);
		}
		
	}

	public static int min(int a,int b) {
		return a<b?a:b;
	}
	
	public static int max(int a,int b) {
		return a>b?a:b;
	}
	
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt()*2;
		int X = sc.nextInt();
		int Y = sc.nextInt();
		
		if(A+B>=C) {
			if(A!=0&&B!=0) {
				int minxy = min(X,Y);
				int numc = C*minxy;
				int sum = numc + A*(X-minxy) + B*(Y-minxy);
				
				int sum2 = C*max(X,Y);
				
				System.out.println(min(sum,sum2));
			}
			if(A==0||B==0) {
				System.out.println(A*X + B*Y);
			}
		}else {
			System.out.println(A*X + B*Y);
		}
		
	}

	public static int min(int a,int b) {
		return a<b?a:b;
	}
	
	public static int max(int a,int b) {
		return a>b?a:b;
	}
	
} Main

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt()*2;
		int X = sc.nextInt();
		int Y = sc.nextInt();
		
		if(A+B>=C) {
			if(A!=0&&B!=0) {
				int minxy = min(X,Y);
				int numc = C*minxy;
				int sum = numc + A*(X-minxy) + B*(Y-minxy);
				
				int sum2 = C*max(X,Y);
				
				System.out.println(min(sum,sum2));
			}
			if(A==0||B==0) {
				System.out.println(A*X + B*Y);
			}
		}else {
			System.out.println(A*X + B*Y);
		}
		
	}

	public static int min(int a,int b) {
		return a<b?a:b;
	}
	
	public static int max(int a,int b) {
		return a>b?a:b;
	}
	
}
