import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long a = in.nextLong();
        long b = in.nextLong();
        long c = in.nextLong();
        long x = in.nextLong();
        long y = in.nextLong();
        long min_price = Long.MAX_VALUE;
        if (x < y) {
            long tmp = x;
            x = y;
            y = tmp;
            tmp = a;
            a = b;
            b = tmp;
        }
        for (long ab_num = 0; ab_num <= x * 2; ab_num += 2) {
            long a_remaining = x - ab_num / 2;
            long b_remaining = y - ab_num / 2;
            b_remaining = Math.max(0, b_remaining);
            min_price = Math.min(min_price, ab_num * c + a_remaining * a + b_remaining * b);
        }
        System.out.println(min_price);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long a = in.nextLong();
        long b = in.nextLong();
        long c = in.nextLong();
        long x = in.nextLong();
        long y = in.nextLong();
        long min_price = Long.MAX_VALUE;
        if (x < y) {
            long tmp = x;
            x = y;
            y = tmp;
            tmp = a;
            a = b;
            b = tmp;
        }
        for (long ab_num = 0; ab_num <= x * 2; ab_num += 2) {
            long a_remaining = x - ab_num / 2;
            long b_remaining = y - ab_num / 2;
            b_remaining = Math.max(0, b_remaining);
            min_price = Math.min(min_price, ab_num * c + a_remaining * a + b_remaining * b);
        }
        System.out.println(min_price);
    }
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long a = in.nextLong();
        long b = in.nextLong();
        long c = in.nextLong();
        long x = in.nextLong();
        long y = in.nextLong();
        long min_price = Long.MAX_VALUE;
        if (x < y) {
            long tmp = x;
            x = y;
            y = tmp;
            tmp = a;
            a = b;
            b = tmp;
        }
        for (long ab_num = 0; ab_num <= x * 2; ab_num += 2) {
            long a_remaining = x - ab_num / 2;
            long b_remaining = y - ab_num / 2;
            b_remaining = Math.max(0, b_remaining);
            min_price = Math.min(min_price, ab_num * c + a_remaining * a + b_remaining * b);
        }
        System.out.println(min_price);
    } main {
        Scanner in = new Scanner(System.in);
        long a = in.nextLong();
        long b = in.nextLong();
        long c = in.nextLong();
        long x = in.nextLong();
        long y = in.nextLong();
        long min_price = Long.MAX_VALUE;
        if (x < y) {
            long tmp = x;
            x = y;
            y = tmp;
            tmp = a;
            a = b;
            b = tmp;
        }
        for (long ab_num = 0; ab_num <= x * 2; ab_num += 2) {
            long a_remaining = x - ab_num / 2;
            long b_remaining = y - ab_num / 2;
            b_remaining = Math.max(0, b_remaining);
            min_price = Math.min(min_price, ab_num * c + a_remaining * a + b_remaining * b);
        }
        System.out.println(min_price);
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) long a = in.nextLong(); a in.nextLong() in.nextLong in long b = in.nextLong(); b in.nextLong() in.nextLong in long c = in.nextLong(); c in.nextLong() in.nextLong in long x = in.nextLong(); x in.nextLong() in.nextLong in long y = in.nextLong(); y in.nextLong() in.nextLong in long min_price = Long.MAX_VALUE; min_price Long.MAX_VALUE Long Long.MAX_VALUE if (x < y) {
            long tmp = x;
            x = y;
            y = tmp;
            tmp = a;
            a = b;
            b = tmp;
        } x < y x y {
            long tmp = x;
            x = y;
            y = tmp;
            tmp = a;
            a = b;
            b = tmp;
        } long tmp = x; tmp x x = y x y y = tmp y tmp tmp = a tmp a a = b a b b = tmp b tmp for (long ab_num = 0; ab_num <= x * 2; ab_num += 2) {
            long a_remaining = x - ab_num / 2;
            long b_remaining = y - ab_num / 2;
            b_remaining = Math.max(0, b_remaining);
            min_price = Math.min(min_price, ab_num * c + a_remaining * a + b_remaining * b);
        } long ab_num = 0; long ab_num = 0; ab_num 0 ab_num <= x * 2 ab_num x * 2 x 2 ab_num += 2 ab_num += 2 ab_num 2 {
            long a_remaining = x - ab_num / 2;
            long b_remaining = y - ab_num / 2;
            b_remaining = Math.max(0, b_remaining);
            min_price = Math.min(min_price, ab_num * c + a_remaining * a + b_remaining * b);
        } {
            long a_remaining = x - ab_num / 2;
            long b_remaining = y - ab_num / 2;
            b_remaining = Math.max(0, b_remaining);
            min_price = Math.min(min_price, ab_num * c + a_remaining * a + b_remaining * b);
        } long a_remaining = x - ab_num / 2; a_remaining x - ab_num / 2 x ab_num / 2 ab_num 2 long b_remaining = y - ab_num / 2; b_remaining y - ab_num / 2 y ab_num / 2 ab_num 2 b_remaining = Math.max(0, b_remaining) b_remaining Math.max(0, b_remaining) Math.max Math 0 b_remaining min_price = Math.min(min_price, ab_num * c + a_remaining * a + b_remaining * b) min_price Math.min(min_price, ab_num * c + a_remaining * a + b_remaining * b) Math.min Math min_price ab_num * c + a_remaining * a + b_remaining * b ab_num * c + a_remaining * a + b_remaining * b ab_num * c ab_num c a_remaining * a a_remaining a b_remaining * b b_remaining b System.out.println(min_price) System.out.println System.out System System.out min_price String[] args args public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long a = in.nextLong();
        long b = in.nextLong();
        long c = in.nextLong();
        long x = in.nextLong();
        long y = in.nextLong();
        long min_price = Long.MAX_VALUE;
        if (x < y) {
            long tmp = x;
            x = y;
            y = tmp;
            tmp = a;
            a = b;
            b = tmp;
        }
        for (long ab_num = 0; ab_num <= x * 2; ab_num += 2) {
            long a_remaining = x - ab_num / 2;
            long b_remaining = y - ab_num / 2;
            b_remaining = Math.max(0, b_remaining);
            min_price = Math.min(min_price, ab_num * c + a_remaining * a + b_remaining * b);
        }
        System.out.println(min_price);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long a = in.nextLong();
        long b = in.nextLong();
        long c = in.nextLong();
        long x = in.nextLong();
        long y = in.nextLong();
        long min_price = Long.MAX_VALUE;
        if (x < y) {
            long tmp = x;
            x = y;
            y = tmp;
            tmp = a;
            a = b;
            b = tmp;
        }
        for (long ab_num = 0; ab_num <= x * 2; ab_num += 2) {
            long a_remaining = x - ab_num / 2;
            long b_remaining = y - ab_num / 2;
            b_remaining = Math.max(0, b_remaining);
            min_price = Math.min(min_price, ab_num * c + a_remaining * a + b_remaining * b);
        }
        System.out.println(min_price);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long a = in.nextLong();
        long b = in.nextLong();
        long c = in.nextLong();
        long x = in.nextLong();
        long y = in.nextLong();
        long min_price = Long.MAX_VALUE;
        if (x < y) {
            long tmp = x;
            x = y;
            y = tmp;
            tmp = a;
            a = b;
            b = tmp;
        }
        for (long ab_num = 0; ab_num <= x * 2; ab_num += 2) {
            long a_remaining = x - ab_num / 2;
            long b_remaining = y - ab_num / 2;
            b_remaining = Math.max(0, b_remaining);
            min_price = Math.min(min_price, ab_num * c + a_remaining * a + b_remaining * b);
        }
        System.out.println(min_price);
    }
}
