import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());
        int C = Integer.parseInt(sc.next());
        int X = Integer.parseInt(sc.next());
        int Y = Integer.parseInt(sc.next());

        int result = 100000 * 5000 * 2;
        for (int i = 0; i <= 100000; i++) {
            result = Math.min(result, i * 2 * C + Math.max(0, X - i) * A + Math.max(0, Y - i) * B);

        }
        System.out.println(result);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());
        int C = Integer.parseInt(sc.next());
        int X = Integer.parseInt(sc.next());
        int Y = Integer.parseInt(sc.next());

        int result = 100000 * 5000 * 2;
        for (int i = 0; i <= 100000; i++) {
            result = Math.min(result, i * 2 * C + Math.max(0, X - i) * A + Math.max(0, Y - i) * B);

        }
        System.out.println(result);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());
        int C = Integer.parseInt(sc.next());
        int X = Integer.parseInt(sc.next());
        int Y = Integer.parseInt(sc.next());

        int result = 100000 * 5000 * 2;
        for (int i = 0; i <= 100000; i++) {
            result = Math.min(result, i * 2 * C + Math.max(0, X - i) * A + Math.max(0, Y - i) * B);

        }
        System.out.println(result);
    } main {
        Scanner sc = new Scanner(System.in);
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());
        int C = Integer.parseInt(sc.next());
        int X = Integer.parseInt(sc.next());
        int Y = Integer.parseInt(sc.next());

        int result = 100000 * 5000 * 2;
        for (int i = 0; i <= 100000; i++) {
            result = Math.min(result, i * 2 * C + Math.max(0, X - i) * A + Math.max(0, Y - i) * B);

        }
        System.out.println(result);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A = Integer.parseInt(sc.next()); A Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int B = Integer.parseInt(sc.next()); B Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int C = Integer.parseInt(sc.next()); C Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int X = Integer.parseInt(sc.next()); X Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int Y = Integer.parseInt(sc.next()); Y Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int result = 100000 * 5000 * 2; result 100000 * 5000 * 2 100000 * 5000 * 2 100000 5000 2 for (int i = 0; i <= 100000; i++) {
            result = Math.min(result, i * 2 * C + Math.max(0, X - i) * A + Math.max(0, Y - i) * B);

        } int i = 0; int i = 0; i 0 i <= 100000 i 100000 i++ i++ i {
            result = Math.min(result, i * 2 * C + Math.max(0, X - i) * A + Math.max(0, Y - i) * B);

        } {
            result = Math.min(result, i * 2 * C + Math.max(0, X - i) * A + Math.max(0, Y - i) * B);

        } result = Math.min(result, i * 2 * C + Math.max(0, X - i) * A + Math.max(0, Y - i) * B) result Math.min(result, i * 2 * C + Math.max(0, X - i) * A + Math.max(0, Y - i) * B) Math.min Math result i * 2 * C + Math.max(0, X - i) * A + Math.max(0, Y - i) * B i * 2 * C + Math.max(0, X - i) * A + Math.max(0, Y - i) * B i * 2 * C i * 2 * C i 2 C Math.max(0, X - i) * A Math.max(0, X - i) Math.max Math 0 X - i X i A Math.max(0, Y - i) * B Math.max(0, Y - i) Math.max Math 0 Y - i Y i B System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());
        int C = Integer.parseInt(sc.next());
        int X = Integer.parseInt(sc.next());
        int Y = Integer.parseInt(sc.next());

        int result = 100000 * 5000 * 2;
        for (int i = 0; i <= 100000; i++) {
            result = Math.min(result, i * 2 * C + Math.max(0, X - i) * A + Math.max(0, Y - i) * B);

        }
        System.out.println(result);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());
        int C = Integer.parseInt(sc.next());
        int X = Integer.parseInt(sc.next());
        int Y = Integer.parseInt(sc.next());

        int result = 100000 * 5000 * 2;
        for (int i = 0; i <= 100000; i++) {
            result = Math.min(result, i * 2 * C + Math.max(0, X - i) * A + Math.max(0, Y - i) * B);

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

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());
        int C = Integer.parseInt(sc.next());
        int X = Integer.parseInt(sc.next());
        int Y = Integer.parseInt(sc.next());

        int result = 100000 * 5000 * 2;
        for (int i = 0; i <= 100000; i++) {
            result = Math.min(result, i * 2 * C + Math.max(0, X - i) * A + Math.max(0, Y - i) * B);

        }
        System.out.println(result);
    }
}