import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        long[] price = new long[3];
        for(int i=0;i<3;i++) price[i]=sc.nextLong();
        long[] piece = new long[2];
        piece[0] = sc.nextLong();
        piece[1] = sc.nextLong();
        if(piece[0]>piece[1]){ // piece[0] is always the pizza less needed
            long med = piece[0];
            piece[0] = piece[1];
            piece[1] = med;
            long priceMed = price[0];
            price[0] =price[1];
            price[1] = priceMed;
        }
        long ans = 0;
        ans += Math.min(price[0]*piece[0]+price[1]*piece[0],price[2]*2*piece[0]);
        ans += Math.min(price[1]*(piece[1]-piece[0]),price[2]*2*(piece[1]-piece[0]));
        System.out.print(ans);
    }
} import java.util.*; util.* java public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        long[] price = new long[3];
        for(int i=0;i<3;i++) price[i]=sc.nextLong();
        long[] piece = new long[2];
        piece[0] = sc.nextLong();
        piece[1] = sc.nextLong();
        if(piece[0]>piece[1]){ // piece[0] is always the pizza less needed
            long med = piece[0];
            piece[0] = piece[1];
            piece[1] = med;
            long priceMed = price[0];
            price[0] =price[1];
            price[1] = priceMed;
        }
        long ans = 0;
        ans += Math.min(price[0]*piece[0]+price[1]*piece[0],price[2]*2*piece[0]);
        ans += Math.min(price[1]*(piece[1]-piece[0]),price[2]*2*(piece[1]-piece[0]));
        System.out.print(ans);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        long[] price = new long[3];
        for(int i=0;i<3;i++) price[i]=sc.nextLong();
        long[] piece = new long[2];
        piece[0] = sc.nextLong();
        piece[1] = sc.nextLong();
        if(piece[0]>piece[1]){ // piece[0] is always the pizza less needed
            long med = piece[0];
            piece[0] = piece[1];
            piece[1] = med;
            long priceMed = price[0];
            price[0] =price[1];
            price[1] = priceMed;
        }
        long ans = 0;
        ans += Math.min(price[0]*piece[0]+price[1]*piece[0],price[2]*2*piece[0]);
        ans += Math.min(price[1]*(piece[1]-piece[0]),price[2]*2*(piece[1]-piece[0]));
        System.out.print(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        long[] price = new long[3];
        for(int i=0;i<3;i++) price[i]=sc.nextLong();
        long[] piece = new long[2];
        piece[0] = sc.nextLong();
        piece[1] = sc.nextLong();
        if(piece[0]>piece[1]){ // piece[0] is always the pizza less needed
            long med = piece[0];
            piece[0] = piece[1];
            piece[1] = med;
            long priceMed = price[0];
            price[0] =price[1];
            price[1] = priceMed;
        }
        long ans = 0;
        ans += Math.min(price[0]*piece[0]+price[1]*piece[0],price[2]*2*piece[0]);
        ans += Math.min(price[1]*(piece[1]-piece[0]),price[2]*2*(piece[1]-piece[0]));
        System.out.print(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long[] price = new long[3]; price new long[3] 3 for(int i=0;i<3;i++) price[i]=sc.nextLong(); int i=0; int i=0; i 0 i<3 i 3 i++ i++ i price[i]=sc.nextLong(); price[i]=sc.nextLong() price[i] price i sc.nextLong() sc.nextLong sc long[] piece = new long[2]; piece new long[2] 2 piece[0] = sc.nextLong() piece[0] piece 0 sc.nextLong() sc.nextLong sc piece[1] = sc.nextLong() piece[1] piece 1 sc.nextLong() sc.nextLong sc if(piece[0]>piece[1]){ // piece[0] is always the pizza less needed
            long med = piece[0];
            piece[0] = piece[1];
            piece[1] = med;
            long priceMed = price[0];
            price[0] =price[1];
            price[1] = priceMed;
        } piece[0]>piece[1] piece[0] piece 0 piece[1] piece 1 { // piece[0] is always the pizza less needed
            long med = piece[0];
            piece[0] = piece[1];
            piece[1] = med;
            long priceMed = price[0];
            price[0] =price[1];
            price[1] = priceMed;
        } long med = piece[0]; med piece[0] piece 0 piece[0] = piece[1] piece[0] piece 0 piece[1] piece 1 piece[1] = med piece[1] piece 1 med long priceMed = price[0]; priceMed price[0] price 0 price[0] =price[1] price[0] price 0 price[1] price 1 price[1] = priceMed price[1] price 1 priceMed long ans = 0; ans 0 ans += Math.min(price[0]*piece[0]+price[1]*piece[0],price[2]*2*piece[0]) ans Math.min(price[0]*piece[0]+price[1]*piece[0],price[2]*2*piece[0]) Math.min Math price[0]*piece[0]+price[1]*piece[0] price[0]*piece[0] price[0] price 0 piece[0] piece 0 price[1]*piece[0] price[1] price 1 piece[0] piece 0 price[2]*2*piece[0] price[2]*2*piece[0] price[2] price 2 2 piece[0] piece 0 ans += Math.min(price[1]*(piece[1]-piece[0]),price[2]*2*(piece[1]-piece[0])) ans Math.min(price[1]*(piece[1]-piece[0]),price[2]*2*(piece[1]-piece[0])) Math.min Math price[1]*(piece[1]-piece[0]) price[1] price 1 (piece[1]-piece[0]) piece[1] piece 1 piece[0] piece 0 price[2]*2*(piece[1]-piece[0]) price[2]*2*(piece[1]-piece[0]) price[2] price 2 2 (piece[1]-piece[0]) piece[1] piece 1 piece[0] piece 0 System.out.print(ans) System.out.print System.out System System.out ans String[] args args public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        long[] price = new long[3];
        for(int i=0;i<3;i++) price[i]=sc.nextLong();
        long[] piece = new long[2];
        piece[0] = sc.nextLong();
        piece[1] = sc.nextLong();
        if(piece[0]>piece[1]){ // piece[0] is always the pizza less needed
            long med = piece[0];
            piece[0] = piece[1];
            piece[1] = med;
            long priceMed = price[0];
            price[0] =price[1];
            price[1] = priceMed;
        }
        long ans = 0;
        ans += Math.min(price[0]*piece[0]+price[1]*piece[0],price[2]*2*piece[0]);
        ans += Math.min(price[1]*(piece[1]-piece[0]),price[2]*2*(piece[1]-piece[0]));
        System.out.print(ans);
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        long[] price = new long[3];
        for(int i=0;i<3;i++) price[i]=sc.nextLong();
        long[] piece = new long[2];
        piece[0] = sc.nextLong();
        piece[1] = sc.nextLong();
        if(piece[0]>piece[1]){ // piece[0] is always the pizza less needed
            long med = piece[0];
            piece[0] = piece[1];
            piece[1] = med;
            long priceMed = price[0];
            price[0] =price[1];
            price[1] = priceMed;
        }
        long ans = 0;
        ans += Math.min(price[0]*piece[0]+price[1]*piece[0],price[2]*2*piece[0]);
        ans += Math.min(price[1]*(piece[1]-piece[0]),price[2]*2*(piece[1]-piece[0]));
        System.out.print(ans);
    }
} Main
import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        long[] price = new long[3];
        for(int i=0;i<3;i++) price[i]=sc.nextLong();
        long[] piece = new long[2];
        piece[0] = sc.nextLong();
        piece[1] = sc.nextLong();
        if(piece[0]>piece[1]){ // piece[0] is always the pizza less needed
            long med = piece[0];
            piece[0] = piece[1];
            piece[1] = med;
            long priceMed = price[0];
            price[0] =price[1];
            price[1] = priceMed;
        }
        long ans = 0;
        ans += Math.min(price[0]*piece[0]+price[1]*piece[0],price[2]*2*piece[0]);
        ans += Math.min(price[1]*(piece[1]-piece[0]),price[2]*2*(piece[1]-piece[0]));
        System.out.print(ans);
    }
}