import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        int A, B, C, X, Y;

        try (Scanner sc = new Scanner(System.in)) {
            A = sc.nextInt();
            B = sc.nextInt();
            C = sc.nextInt();
            X = sc.nextInt();
            Y = sc.nextInt();
        }
        int result = 0;
        int C2 = 2 * C;
        int sagaku = C2 - (A + B);
        int min = X < Y ? X : Y;
        if (sagaku < 0) {
            result += C2 * min;
        } else {
            result += A * min;
            result += B * min;
        }

        if (X > Y) {
            if (A > C2) {
                result += C2 * (X - Y);
            } else {
                result += A * (X - Y);
            }
        } else if (X < Y) {
            if (B > C2) {
                result += C2 * (Y - X);
            } else {
                result += B * (Y - X);
            }
        }

        System.out.println(result);
    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        int A, B, C, X, Y;

        try (Scanner sc = new Scanner(System.in)) {
            A = sc.nextInt();
            B = sc.nextInt();
            C = sc.nextInt();
            X = sc.nextInt();
            Y = sc.nextInt();
        }
        int result = 0;
        int C2 = 2 * C;
        int sagaku = C2 - (A + B);
        int min = X < Y ? X : Y;
        if (sagaku < 0) {
            result += C2 * min;
        } else {
            result += A * min;
            result += B * min;
        }

        if (X > Y) {
            if (A > C2) {
                result += C2 * (X - Y);
            } else {
                result += A * (X - Y);
            }
        } else if (X < Y) {
            if (B > C2) {
                result += C2 * (Y - X);
            } else {
                result += B * (Y - X);
            }
        }

        System.out.println(result);
    }
} Main public static void main(String[] args) {
        int A, B, C, X, Y;

        try (Scanner sc = new Scanner(System.in)) {
            A = sc.nextInt();
            B = sc.nextInt();
            C = sc.nextInt();
            X = sc.nextInt();
            Y = sc.nextInt();
        }
        int result = 0;
        int C2 = 2 * C;
        int sagaku = C2 - (A + B);
        int min = X < Y ? X : Y;
        if (sagaku < 0) {
            result += C2 * min;
        } else {
            result += A * min;
            result += B * min;
        }

        if (X > Y) {
            if (A > C2) {
                result += C2 * (X - Y);
            } else {
                result += A * (X - Y);
            }
        } else if (X < Y) {
            if (B > C2) {
                result += C2 * (Y - X);
            } else {
                result += B * (Y - X);
            }
        }

        System.out.println(result);
    } main {
        int A, B, C, X, Y;

        try (Scanner sc = new Scanner(System.in)) {
            A = sc.nextInt();
            B = sc.nextInt();
            C = sc.nextInt();
            X = sc.nextInt();
            Y = sc.nextInt();
        }
        int result = 0;
        int C2 = 2 * C;
        int sagaku = C2 - (A + B);
        int min = X < Y ? X : Y;
        if (sagaku < 0) {
            result += C2 * min;
        } else {
            result += A * min;
            result += B * min;
        }

        if (X > Y) {
            if (A > C2) {
                result += C2 * (X - Y);
            } else {
                result += A * (X - Y);
            }
        } else if (X < Y) {
            if (B > C2) {
                result += C2 * (Y - X);
            } else {
                result += B * (Y - X);
            }
        }

        System.out.println(result);
    } int A A B B C C X X Y; Y try (Scanner sc = new Scanner(System.in)) {
            A = sc.nextInt();
            B = sc.nextInt();
            C = sc.nextInt();
            X = sc.nextInt();
            Y = sc.nextInt();
        } {
            A = sc.nextInt();
            B = sc.nextInt();
            C = sc.nextInt();
            X = sc.nextInt();
            Y = sc.nextInt();
        } Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) A = sc.nextInt() A sc.nextInt() sc.nextInt sc B = sc.nextInt() B sc.nextInt() sc.nextInt sc C = sc.nextInt() C sc.nextInt() sc.nextInt sc X = sc.nextInt() X sc.nextInt() sc.nextInt sc Y = sc.nextInt() Y sc.nextInt() sc.nextInt sc int result = 0; result 0 int C2 = 2 * C; C2 2 * C 2 C int sagaku = C2 - (A + B); sagaku C2 - (A + B) C2 (A + B) A B int min = X < Y ? X : Y; min X < Y ? X : Y X < Y X Y X Y if (sagaku < 0) {
            result += C2 * min;
        } else {
            result += A * min;
            result += B * min;
        } sagaku < 0 sagaku 0 {
            result += C2 * min;
        } result += C2 * min result C2 * min C2 min {
            result += A * min;
            result += B * min;
        } result += A * min result A * min A min result += B * min result B * min B min if (X > Y) {
            if (A > C2) {
                result += C2 * (X - Y);
            } else {
                result += A * (X - Y);
            }
        } else if (X < Y) {
            if (B > C2) {
                result += C2 * (Y - X);
            } else {
                result += B * (Y - X);
            }
        } X > Y X Y {
            if (A > C2) {
                result += C2 * (X - Y);
            } else {
                result += A * (X - Y);
            }
        } if (A > C2) {
                result += C2 * (X - Y);
            } else {
                result += A * (X - Y);
            } A > C2 A C2 {
                result += C2 * (X - Y);
            } result += C2 * (X - Y) result C2 * (X - Y) C2 (X - Y) X Y {
                result += A * (X - Y);
            } result += A * (X - Y) result A * (X - Y) A (X - Y) X Y if (X < Y) {
            if (B > C2) {
                result += C2 * (Y - X);
            } else {
                result += B * (Y - X);
            }
        } X < Y X Y {
            if (B > C2) {
                result += C2 * (Y - X);
            } else {
                result += B * (Y - X);
            }
        } if (B > C2) {
                result += C2 * (Y - X);
            } else {
                result += B * (Y - X);
            } B > C2 B C2 {
                result += C2 * (Y - X);
            } result += C2 * (Y - X) result C2 * (Y - X) C2 (Y - X) Y X {
                result += B * (Y - X);
            } result += B * (Y - X) result B * (Y - X) B (Y - X) Y X 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) {
        int A, B, C, X, Y;

        try (Scanner sc = new Scanner(System.in)) {
            A = sc.nextInt();
            B = sc.nextInt();
            C = sc.nextInt();
            X = sc.nextInt();
            Y = sc.nextInt();
        }
        int result = 0;
        int C2 = 2 * C;
        int sagaku = C2 - (A + B);
        int min = X < Y ? X : Y;
        if (sagaku < 0) {
            result += C2 * min;
        } else {
            result += A * min;
            result += B * min;
        }

        if (X > Y) {
            if (A > C2) {
                result += C2 * (X - Y);
            } else {
                result += A * (X - Y);
            }
        } else if (X < Y) {
            if (B > C2) {
                result += C2 * (Y - X);
            } else {
                result += B * (Y - X);
            }
        }

        System.out.println(result);
    }
} public class Main {
    public static void main(String[] args) {
        int A, B, C, X, Y;

        try (Scanner sc = new Scanner(System.in)) {
            A = sc.nextInt();
            B = sc.nextInt();
            C = sc.nextInt();
            X = sc.nextInt();
            Y = sc.nextInt();
        }
        int result = 0;
        int C2 = 2 * C;
        int sagaku = C2 - (A + B);
        int min = X < Y ? X : Y;
        if (sagaku < 0) {
            result += C2 * min;
        } else {
            result += A * min;
            result += B * min;
        }

        if (X > Y) {
            if (A > C2) {
                result += C2 * (X - Y);
            } else {
                result += A * (X - Y);
            }
        } else if (X < Y) {
            if (B > C2) {
                result += C2 * (Y - X);
            } else {
                result += B * (Y - X);
            }
        }

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

public class Main {
    public static void main(String[] args) {
        int A, B, C, X, Y;

        try (Scanner sc = new Scanner(System.in)) {
            A = sc.nextInt();
            B = sc.nextInt();
            C = sc.nextInt();
            X = sc.nextInt();
            Y = sc.nextInt();
        }
        int result = 0;
        int C2 = 2 * C;
        int sagaku = C2 - (A + B);
        int min = X < Y ? X : Y;
        if (sagaku < 0) {
            result += C2 * min;
        } else {
            result += A * min;
            result += B * min;
        }

        if (X > Y) {
            if (A > C2) {
                result += C2 * (X - Y);
            } else {
                result += A * (X - Y);
            }
        } else if (X < Y) {
            if (B > C2) {
                result += C2 * (Y - X);
            } else {
                result += B * (Y - X);
            }
        }

        System.out.println(result);
    }
}
