import java.util.*;

public class Main {

    public static void main(String[] args) {
        // write your code here
        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();

        long ans = Long.MAX_VALUE;

        for (int i = 0; i < x + y; i++) {
            long value = c * i + Math.max(0, (x - i) * a) + Math.max(0, (y - i) * b);
            if (value < ans) {
                ans = value;
            }
        }

        System.out.println(ans);
    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        // write your code here
        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();

        long ans = Long.MAX_VALUE;

        for (int i = 0; i < x + y; i++) {
            long value = c * i + Math.max(0, (x - i) * a) + Math.max(0, (y - i) * b);
            if (value < ans) {
                ans = value;
            }
        }

        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        // write your code here
        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();

        long ans = Long.MAX_VALUE;

        for (int i = 0; i < x + y; i++) {
            long value = c * i + Math.max(0, (x - i) * a) + Math.max(0, (y - i) * b);
            if (value < ans) {
                ans = value;
            }
        }

        System.out.println(ans);
    } main {
        // write your code here
        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();

        long ans = Long.MAX_VALUE;

        for (int i = 0; i < x + y; i++) {
            long value = c * i + Math.max(0, (x - i) * a) + Math.max(0, (y - i) * b);
            if (value < ans) {
                ans = value;
            }
        }

        System.out.println(ans);
    } 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 long ans = Long.MAX_VALUE; ans Long.MAX_VALUE Long Long.MAX_VALUE for (int i = 0; i < x + y; i++) {
            long value = c * i + Math.max(0, (x - i) * a) + Math.max(0, (y - i) * b);
            if (value < ans) {
                ans = value;
            }
        } int i = 0; int i = 0; i 0 i < x + y i x + y x y i++ i++ i {
            long value = c * i + Math.max(0, (x - i) * a) + Math.max(0, (y - i) * b);
            if (value < ans) {
                ans = value;
            }
        } {
            long value = c * i + Math.max(0, (x - i) * a) + Math.max(0, (y - i) * b);
            if (value < ans) {
                ans = value;
            }
        } long value = c * i + Math.max(0, (x - i) * a) + Math.max(0, (y - i) * b); value c * i + Math.max(0, (x - i) * a) + Math.max(0, (y - i) * b) c * i + Math.max(0, (x - i) * a) + Math.max(0, (y - i) * b) c * i c i Math.max(0, (x - i) * a) Math.max Math 0 (x - i) * a (x - i) x i a Math.max(0, (y - i) * b) Math.max Math 0 (y - i) * b (y - i) y i b if (value < ans) {
                ans = value;
            } value < ans value ans {
                ans = value;
            } ans = value ans value System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

    public static void main(String[] args) {
        // write your code here
        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();

        long ans = Long.MAX_VALUE;

        for (int i = 0; i < x + y; i++) {
            long value = c * i + Math.max(0, (x - i) * a) + Math.max(0, (y - i) * b);
            if (value < ans) {
                ans = value;
            }
        }

        System.out.println(ans);
    }
} public class Main {

    public static void main(String[] args) {
        // write your code here
        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();

        long ans = Long.MAX_VALUE;

        for (int i = 0; i < x + y; i++) {
            long value = c * i + Math.max(0, (x - i) * a) + Math.max(0, (y - i) * b);
            if (value < ans) {
                ans = value;
            }
        }

        System.out.println(ans);
    }
} Main
import java.util.*;

public class Main {

    public static void main(String[] args) {
        // write your code here
        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();

        long ans = Long.MAX_VALUE;

        for (int i = 0; i < x + y; i++) {
            long value = c * i + Math.max(0, (x - i) * a) + Math.max(0, (y - i) * b);
            if (value < ans) {
                ans = value;
            }
        }

        System.out.println(ans);
    }
}