import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        long a = sc.nextLong();
        long b = sc.nextLong();
        long c = sc.nextLong();
        long x = sc.nextLong();
        long y = sc.nextLong();

        long sum = 0;

        if ((a + b) > (c * 2)) {
            long cbuy = Math.min(x, y);
            sum = sum + ((c * 2) * cbuy);
            x = x - cbuy;
            y = y - cbuy;
        }

        if (a > (c * 2)) {
            long cbuy = x;
            sum = sum + ((c * 2) * cbuy);
            x = x - cbuy;
        }

        if (b > (c * 2)) {
            long cbuy = y;
            sum = sum + ((c * 2) * cbuy);
            y = y - cbuy;
        }

        sum = sum + (a * x);
        sum = sum + (b * y);

        System.out.println(sum);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        long a = sc.nextLong();
        long b = sc.nextLong();
        long c = sc.nextLong();
        long x = sc.nextLong();
        long y = sc.nextLong();

        long sum = 0;

        if ((a + b) > (c * 2)) {
            long cbuy = Math.min(x, y);
            sum = sum + ((c * 2) * cbuy);
            x = x - cbuy;
            y = y - cbuy;
        }

        if (a > (c * 2)) {
            long cbuy = x;
            sum = sum + ((c * 2) * cbuy);
            x = x - cbuy;
        }

        if (b > (c * 2)) {
            long cbuy = y;
            sum = sum + ((c * 2) * cbuy);
            y = y - cbuy;
        }

        sum = sum + (a * x);
        sum = sum + (b * y);

        System.out.println(sum);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        long a = sc.nextLong();
        long b = sc.nextLong();
        long c = sc.nextLong();
        long x = sc.nextLong();
        long y = sc.nextLong();

        long sum = 0;

        if ((a + b) > (c * 2)) {
            long cbuy = Math.min(x, y);
            sum = sum + ((c * 2) * cbuy);
            x = x - cbuy;
            y = y - cbuy;
        }

        if (a > (c * 2)) {
            long cbuy = x;
            sum = sum + ((c * 2) * cbuy);
            x = x - cbuy;
        }

        if (b > (c * 2)) {
            long cbuy = y;
            sum = sum + ((c * 2) * cbuy);
            y = y - cbuy;
        }

        sum = sum + (a * x);
        sum = sum + (b * y);

        System.out.println(sum);
    } main {
        Scanner sc = new Scanner(System.in);

        long a = sc.nextLong();
        long b = sc.nextLong();
        long c = sc.nextLong();
        long x = sc.nextLong();
        long y = sc.nextLong();

        long sum = 0;

        if ((a + b) > (c * 2)) {
            long cbuy = Math.min(x, y);
            sum = sum + ((c * 2) * cbuy);
            x = x - cbuy;
            y = y - cbuy;
        }

        if (a > (c * 2)) {
            long cbuy = x;
            sum = sum + ((c * 2) * cbuy);
            x = x - cbuy;
        }

        if (b > (c * 2)) {
            long cbuy = y;
            sum = sum + ((c * 2) * cbuy);
            y = y - cbuy;
        }

        sum = sum + (a * x);
        sum = sum + (b * y);

        System.out.println(sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long a = sc.nextLong(); a sc.nextLong() sc.nextLong sc long b = sc.nextLong(); b sc.nextLong() sc.nextLong sc long c = sc.nextLong(); c sc.nextLong() sc.nextLong sc long x = sc.nextLong(); x sc.nextLong() sc.nextLong sc long y = sc.nextLong(); y sc.nextLong() sc.nextLong sc long sum = 0; sum 0 if ((a + b) > (c * 2)) {
            long cbuy = Math.min(x, y);
            sum = sum + ((c * 2) * cbuy);
            x = x - cbuy;
            y = y - cbuy;
        } (a + b) > (c * 2) (a + b) a b (c * 2) c 2 {
            long cbuy = Math.min(x, y);
            sum = sum + ((c * 2) * cbuy);
            x = x - cbuy;
            y = y - cbuy;
        } long cbuy = Math.min(x, y); cbuy Math.min(x, y) Math.min Math x y sum = sum + ((c * 2) * cbuy) sum sum + ((c * 2) * cbuy) sum ((c * 2) * cbuy) (c * 2) c 2 cbuy x = x - cbuy x x - cbuy x cbuy y = y - cbuy y y - cbuy y cbuy if (a > (c * 2)) {
            long cbuy = x;
            sum = sum + ((c * 2) * cbuy);
            x = x - cbuy;
        } a > (c * 2) a (c * 2) c 2 {
            long cbuy = x;
            sum = sum + ((c * 2) * cbuy);
            x = x - cbuy;
        } long cbuy = x; cbuy x sum = sum + ((c * 2) * cbuy) sum sum + ((c * 2) * cbuy) sum ((c * 2) * cbuy) (c * 2) c 2 cbuy x = x - cbuy x x - cbuy x cbuy if (b > (c * 2)) {
            long cbuy = y;
            sum = sum + ((c * 2) * cbuy);
            y = y - cbuy;
        } b > (c * 2) b (c * 2) c 2 {
            long cbuy = y;
            sum = sum + ((c * 2) * cbuy);
            y = y - cbuy;
        } long cbuy = y; cbuy y sum = sum + ((c * 2) * cbuy) sum sum + ((c * 2) * cbuy) sum ((c * 2) * cbuy) (c * 2) c 2 cbuy y = y - cbuy y y - cbuy y cbuy sum = sum + (a * x) sum sum + (a * x) sum (a * x) a x sum = sum + (b * y) sum sum + (b * y) sum (b * y) b y System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        long a = sc.nextLong();
        long b = sc.nextLong();
        long c = sc.nextLong();
        long x = sc.nextLong();
        long y = sc.nextLong();

        long sum = 0;

        if ((a + b) > (c * 2)) {
            long cbuy = Math.min(x, y);
            sum = sum + ((c * 2) * cbuy);
            x = x - cbuy;
            y = y - cbuy;
        }

        if (a > (c * 2)) {
            long cbuy = x;
            sum = sum + ((c * 2) * cbuy);
            x = x - cbuy;
        }

        if (b > (c * 2)) {
            long cbuy = y;
            sum = sum + ((c * 2) * cbuy);
            y = y - cbuy;
        }

        sum = sum + (a * x);
        sum = sum + (b * y);

        System.out.println(sum);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        long a = sc.nextLong();
        long b = sc.nextLong();
        long c = sc.nextLong();
        long x = sc.nextLong();
        long y = sc.nextLong();

        long sum = 0;

        if ((a + b) > (c * 2)) {
            long cbuy = Math.min(x, y);
            sum = sum + ((c * 2) * cbuy);
            x = x - cbuy;
            y = y - cbuy;
        }

        if (a > (c * 2)) {
            long cbuy = x;
            sum = sum + ((c * 2) * cbuy);
            x = x - cbuy;
        }

        if (b > (c * 2)) {
            long cbuy = y;
            sum = sum + ((c * 2) * cbuy);
            y = y - cbuy;
        }

        sum = sum + (a * x);
        sum = sum + (b * y);

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

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        long a = sc.nextLong();
        long b = sc.nextLong();
        long c = sc.nextLong();
        long x = sc.nextLong();
        long y = sc.nextLong();

        long sum = 0;

        if ((a + b) > (c * 2)) {
            long cbuy = Math.min(x, y);
            sum = sum + ((c * 2) * cbuy);
            x = x - cbuy;
            y = y - cbuy;
        }

        if (a > (c * 2)) {
            long cbuy = x;
            sum = sum + ((c * 2) * cbuy);
            x = x - cbuy;
        }

        if (b > (c * 2)) {
            long cbuy = y;
            sum = sum + ((c * 2) * cbuy);
            y = y - cbuy;
        }

        sum = sum + (a * x);
        sum = sum + (b * y);

        System.out.println(sum);
    }
}