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();
        int X = sc.nextInt();
        int Y = sc.nextInt();
        int total = CorAtoB(A,B,C,X,Y);
        if(X > Y){
            total += CorA(A,C,X,Y);
        }
        else if(X < Y){
            total += CorA(B,C,X,Y);
        }
        System.out.println(total);

    }
    public static int CorA(int A,int C,int X,int Y){
        int total = 0;
        for(int i = 0;i < absolute(X,Y);i++){
            if(A <= 2*C){
                total += A;
            }
            else{
                total += 2*C;
            }
        }
        return total;
    }
    public static int CorAtoB(int A,int B,int C,int X,int Y){
        int total = 0;
        for(int i = 0;i < min(X,Y);i++){
            if(A + B > 2*C){
                total += 2*C;
            }
            else{
                total += A+B;
            }
        }
        return total;
    }
    public static int min(int X,int Y){
        if(X > Y){
            return Y;
        }
        else{
            return X;
        }
    }
    public static int absolute(int X,int Y){
        int z;
        if(X > Y){
            z = X - Y;
        }
        else{
            z = Y - X;
        }
        return z;
    }
} 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();
        int X = sc.nextInt();
        int Y = sc.nextInt();
        int total = CorAtoB(A,B,C,X,Y);
        if(X > Y){
            total += CorA(A,C,X,Y);
        }
        else if(X < Y){
            total += CorA(B,C,X,Y);
        }
        System.out.println(total);

    }
    public static int CorA(int A,int C,int X,int Y){
        int total = 0;
        for(int i = 0;i < absolute(X,Y);i++){
            if(A <= 2*C){
                total += A;
            }
            else{
                total += 2*C;
            }
        }
        return total;
    }
    public static int CorAtoB(int A,int B,int C,int X,int Y){
        int total = 0;
        for(int i = 0;i < min(X,Y);i++){
            if(A + B > 2*C){
                total += 2*C;
            }
            else{
                total += A+B;
            }
        }
        return total;
    }
    public static int min(int X,int Y){
        if(X > Y){
            return Y;
        }
        else{
            return X;
        }
    }
    public static int absolute(int X,int Y){
        int z;
        if(X > Y){
            z = X - Y;
        }
        else{
            z = Y - X;
        }
        return z;
    }
} 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();
        int X = sc.nextInt();
        int Y = sc.nextInt();
        int total = CorAtoB(A,B,C,X,Y);
        if(X > Y){
            total += CorA(A,C,X,Y);
        }
        else if(X < Y){
            total += CorA(B,C,X,Y);
        }
        System.out.println(total);

    } main {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int X = sc.nextInt();
        int Y = sc.nextInt();
        int total = CorAtoB(A,B,C,X,Y);
        if(X > Y){
            total += CorA(A,C,X,Y);
        }
        else if(X < Y){
            total += CorA(B,C,X,Y);
        }
        System.out.println(total);

    } 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(); C sc.nextInt() sc.nextInt sc int X = sc.nextInt(); X sc.nextInt() sc.nextInt sc int Y = sc.nextInt(); Y sc.nextInt() sc.nextInt sc int total = CorAtoB(A,B,C,X,Y); total CorAtoB(A,B,C,X,Y) CorAtoB A B C X Y if(X > Y){
            total += CorA(A,C,X,Y);
        }
        else if(X < Y){
            total += CorA(B,C,X,Y);
        } X > Y X Y {
            total += CorA(A,C,X,Y);
        } total += CorA(A,C,X,Y) total CorA(A,C,X,Y) CorA A C X Y if(X < Y){
            total += CorA(B,C,X,Y);
        } X < Y X Y {
            total += CorA(B,C,X,Y);
        } total += CorA(B,C,X,Y) total CorA(B,C,X,Y) CorA B C X Y System.out.println(total) System.out.println System.out System System.out total String[] args args public static int CorA(int A,int C,int X,int Y){
        int total = 0;
        for(int i = 0;i < absolute(X,Y);i++){
            if(A <= 2*C){
                total += A;
            }
            else{
                total += 2*C;
            }
        }
        return total;
    } CorA {
        int total = 0;
        for(int i = 0;i < absolute(X,Y);i++){
            if(A <= 2*C){
                total += A;
            }
            else{
                total += 2*C;
            }
        }
        return total;
    } int total = 0; total 0 for(int i = 0;i < absolute(X,Y);i++){
            if(A <= 2*C){
                total += A;
            }
            else{
                total += 2*C;
            }
        } int i = 0; int i = 0; i 0 i < absolute(X,Y) i absolute(X,Y) absolute X Y i++ i++ i {
            if(A <= 2*C){
                total += A;
            }
            else{
                total += 2*C;
            }
        } {
            if(A <= 2*C){
                total += A;
            }
            else{
                total += 2*C;
            }
        } if(A <= 2*C){
                total += A;
            }
            else{
                total += 2*C;
            } A <= 2*C A 2*C 2 C {
                total += A;
            } total += A total A {
                total += 2*C;
            } total += 2*C total 2*C 2 C return total; total int A A int C C int X X int Y Y public static int CorAtoB(int A,int B,int C,int X,int Y){
        int total = 0;
        for(int i = 0;i < min(X,Y);i++){
            if(A + B > 2*C){
                total += 2*C;
            }
            else{
                total += A+B;
            }
        }
        return total;
    } CorAtoB {
        int total = 0;
        for(int i = 0;i < min(X,Y);i++){
            if(A + B > 2*C){
                total += 2*C;
            }
            else{
                total += A+B;
            }
        }
        return total;
    } int total = 0; total 0 for(int i = 0;i < min(X,Y);i++){
            if(A + B > 2*C){
                total += 2*C;
            }
            else{
                total += A+B;
            }
        } int i = 0; int i = 0; i 0 i < min(X,Y) i min(X,Y) min X Y i++ i++ i {
            if(A + B > 2*C){
                total += 2*C;
            }
            else{
                total += A+B;
            }
        } {
            if(A + B > 2*C){
                total += 2*C;
            }
            else{
                total += A+B;
            }
        } if(A + B > 2*C){
                total += 2*C;
            }
            else{
                total += A+B;
            } A + B > 2*C A + B A B 2*C 2 C {
                total += 2*C;
            } total += 2*C total 2*C 2 C {
                total += A+B;
            } total += A+B total A+B A B return total; total int A A int B B int C C int X X int Y Y public static int min(int X,int Y){
        if(X > Y){
            return Y;
        }
        else{
            return X;
        }
    } min {
        if(X > Y){
            return Y;
        }
        else{
            return X;
        }
    } if(X > Y){
            return Y;
        }
        else{
            return X;
        } X > Y X Y {
            return Y;
        } return Y; Y {
            return X;
        } return X; X int X X int Y Y public static int absolute(int X,int Y){
        int z;
        if(X > Y){
            z = X - Y;
        }
        else{
            z = Y - X;
        }
        return z;
    } absolute {
        int z;
        if(X > Y){
            z = X - Y;
        }
        else{
            z = Y - X;
        }
        return z;
    } int z; z if(X > Y){
            z = X - Y;
        }
        else{
            z = Y - X;
        } X > Y X Y {
            z = X - Y;
        } z = X - Y z X - Y X Y {
            z = Y - X;
        } z = Y - X z Y - X Y X return z; z int X X int Y Y 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();
        int X = sc.nextInt();
        int Y = sc.nextInt();
        int total = CorAtoB(A,B,C,X,Y);
        if(X > Y){
            total += CorA(A,C,X,Y);
        }
        else if(X < Y){
            total += CorA(B,C,X,Y);
        }
        System.out.println(total);

    }
    public static int CorA(int A,int C,int X,int Y){
        int total = 0;
        for(int i = 0;i < absolute(X,Y);i++){
            if(A <= 2*C){
                total += A;
            }
            else{
                total += 2*C;
            }
        }
        return total;
    }
    public static int CorAtoB(int A,int B,int C,int X,int Y){
        int total = 0;
        for(int i = 0;i < min(X,Y);i++){
            if(A + B > 2*C){
                total += 2*C;
            }
            else{
                total += A+B;
            }
        }
        return total;
    }
    public static int min(int X,int Y){
        if(X > Y){
            return Y;
        }
        else{
            return X;
        }
    }
    public static int absolute(int X,int Y){
        int z;
        if(X > Y){
            z = X - Y;
        }
        else{
            z = Y - X;
        }
        return z;
    }
} 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();
        int X = sc.nextInt();
        int Y = sc.nextInt();
        int total = CorAtoB(A,B,C,X,Y);
        if(X > Y){
            total += CorA(A,C,X,Y);
        }
        else if(X < Y){
            total += CorA(B,C,X,Y);
        }
        System.out.println(total);

    }
    public static int CorA(int A,int C,int X,int Y){
        int total = 0;
        for(int i = 0;i < absolute(X,Y);i++){
            if(A <= 2*C){
                total += A;
            }
            else{
                total += 2*C;
            }
        }
        return total;
    }
    public static int CorAtoB(int A,int B,int C,int X,int Y){
        int total = 0;
        for(int i = 0;i < min(X,Y);i++){
            if(A + B > 2*C){
                total += 2*C;
            }
            else{
                total += A+B;
            }
        }
        return total;
    }
    public static int min(int X,int Y){
        if(X > Y){
            return Y;
        }
        else{
            return X;
        }
    }
    public static int absolute(int X,int Y){
        int z;
        if(X > Y){
            z = X - Y;
        }
        else{
            z = Y - X;
        }
        return z;
    }
} 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();
        int X = sc.nextInt();
        int Y = sc.nextInt();
        int total = CorAtoB(A,B,C,X,Y);
        if(X > Y){
            total += CorA(A,C,X,Y);
        }
        else if(X < Y){
            total += CorA(B,C,X,Y);
        }
        System.out.println(total);

    }
    public static int CorA(int A,int C,int X,int Y){
        int total = 0;
        for(int i = 0;i < absolute(X,Y);i++){
            if(A <= 2*C){
                total += A;
            }
            else{
                total += 2*C;
            }
        }
        return total;
    }
    public static int CorAtoB(int A,int B,int C,int X,int Y){
        int total = 0;
        for(int i = 0;i < min(X,Y);i++){
            if(A + B > 2*C){
                total += 2*C;
            }
            else{
                total += A+B;
            }
        }
        return total;
    }
    public static int min(int X,int Y){
        if(X > Y){
            return Y;
        }
        else{
            return X;
        }
    }
    public static int absolute(int X,int Y){
        int z;
        if(X > Y){
            z = X - Y;
        }
        else{
            z = Y - X;
        }
        return z;
    }
}
