import java.util.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int x = sc.nextInt();
        int y = sc.nextInt();
        int ans = 0;
        if (2 * c < a && 2 * c < b) {
            int p = Math.max(x, y);
            ans = 2 * p * c;
        } else if (2 * c < a) {
            int p = Math.max(0, y - x);
            ans = 2 * x * c + b * p;
        } else if (2 * c < b) {
            int p = Math.max(0, x - y);
            ans = 2 * y * c + a * p;
        } else if (2 * c < a + b) {
            if (x < y) {
                ans += 2 * x * c;
                ans += (y - x) * b;
            } else {
                ans += 2 * y * c;
                ans += (x - y) * a;
            }
        } else {
            ans = a * x + b * y;
        }
        System.out.println(ans);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int x = sc.nextInt();
        int y = sc.nextInt();
        int ans = 0;
        if (2 * c < a && 2 * c < b) {
            int p = Math.max(x, y);
            ans = 2 * p * c;
        } else if (2 * c < a) {
            int p = Math.max(0, y - x);
            ans = 2 * x * c + b * p;
        } else if (2 * c < b) {
            int p = Math.max(0, x - y);
            ans = 2 * y * c + a * p;
        } else if (2 * c < a + b) {
            if (x < y) {
                ans += 2 * x * c;
                ans += (y - x) * b;
            } else {
                ans += 2 * y * c;
                ans += (x - y) * a;
            }
        } else {
            ans = a * x + b * y;
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int x = sc.nextInt();
        int y = sc.nextInt();
        int ans = 0;
        if (2 * c < a && 2 * c < b) {
            int p = Math.max(x, y);
            ans = 2 * p * c;
        } else if (2 * c < a) {
            int p = Math.max(0, y - x);
            ans = 2 * x * c + b * p;
        } else if (2 * c < b) {
            int p = Math.max(0, x - y);
            ans = 2 * y * c + a * p;
        } else if (2 * c < a + b) {
            if (x < y) {
                ans += 2 * x * c;
                ans += (y - x) * b;
            } else {
                ans += 2 * y * c;
                ans += (x - y) * a;
            }
        } else {
            ans = a * x + b * y;
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int x = sc.nextInt();
        int y = sc.nextInt();
        int ans = 0;
        if (2 * c < a && 2 * c < b) {
            int p = Math.max(x, y);
            ans = 2 * p * c;
        } else if (2 * c < a) {
            int p = Math.max(0, y - x);
            ans = 2 * x * c + b * p;
        } else if (2 * c < b) {
            int p = Math.max(0, x - y);
            ans = 2 * y * c + a * p;
        } else if (2 * c < a + b) {
            if (x < y) {
                ans += 2 * x * c;
                ans += (y - x) * b;
            } else {
                ans += 2 * y * c;
                ans += (x - y) * a;
            }
        } else {
            ans = a * x + b * y;
        }
        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(); c sc.nextInt() sc.nextInt sc int x = sc.nextInt(); x sc.nextInt() sc.nextInt sc int y = sc.nextInt(); y sc.nextInt() sc.nextInt sc int ans = 0; ans 0 if (2 * c < a && 2 * c < b) {
            int p = Math.max(x, y);
            ans = 2 * p * c;
        } else if (2 * c < a) {
            int p = Math.max(0, y - x);
            ans = 2 * x * c + b * p;
        } else if (2 * c < b) {
            int p = Math.max(0, x - y);
            ans = 2 * y * c + a * p;
        } else if (2 * c < a + b) {
            if (x < y) {
                ans += 2 * x * c;
                ans += (y - x) * b;
            } else {
                ans += 2 * y * c;
                ans += (x - y) * a;
            }
        } else {
            ans = a * x + b * y;
        } 2 * c < a && 2 * c < b 2 * c < a 2 * c 2 c a 2 * c < b 2 * c 2 c b {
            int p = Math.max(x, y);
            ans = 2 * p * c;
        } int p = Math.max(x, y); p Math.max(x, y) Math.max Math x y ans = 2 * p * c ans 2 * p * c 2 * p * c 2 p c if (2 * c < a) {
            int p = Math.max(0, y - x);
            ans = 2 * x * c + b * p;
        } else if (2 * c < b) {
            int p = Math.max(0, x - y);
            ans = 2 * y * c + a * p;
        } else if (2 * c < a + b) {
            if (x < y) {
                ans += 2 * x * c;
                ans += (y - x) * b;
            } else {
                ans += 2 * y * c;
                ans += (x - y) * a;
            }
        } else {
            ans = a * x + b * y;
        } 2 * c < a 2 * c 2 c a {
            int p = Math.max(0, y - x);
            ans = 2 * x * c + b * p;
        } int p = Math.max(0, y - x); p Math.max(0, y - x) Math.max Math 0 y - x y x ans = 2 * x * c + b * p ans 2 * x * c + b * p 2 * x * c 2 * x * c 2 x c b * p b p if (2 * c < b) {
            int p = Math.max(0, x - y);
            ans = 2 * y * c + a * p;
        } else if (2 * c < a + b) {
            if (x < y) {
                ans += 2 * x * c;
                ans += (y - x) * b;
            } else {
                ans += 2 * y * c;
                ans += (x - y) * a;
            }
        } else {
            ans = a * x + b * y;
        } 2 * c < b 2 * c 2 c b {
            int p = Math.max(0, x - y);
            ans = 2 * y * c + a * p;
        } int p = Math.max(0, x - y); p Math.max(0, x - y) Math.max Math 0 x - y x y ans = 2 * y * c + a * p ans 2 * y * c + a * p 2 * y * c 2 * y * c 2 y c a * p a p if (2 * c < a + b) {
            if (x < y) {
                ans += 2 * x * c;
                ans += (y - x) * b;
            } else {
                ans += 2 * y * c;
                ans += (x - y) * a;
            }
        } else {
            ans = a * x + b * y;
        } 2 * c < a + b 2 * c 2 c a + b a b {
            if (x < y) {
                ans += 2 * x * c;
                ans += (y - x) * b;
            } else {
                ans += 2 * y * c;
                ans += (x - y) * a;
            }
        } if (x < y) {
                ans += 2 * x * c;
                ans += (y - x) * b;
            } else {
                ans += 2 * y * c;
                ans += (x - y) * a;
            } x < y x y {
                ans += 2 * x * c;
                ans += (y - x) * b;
            } ans += 2 * x * c ans 2 * x * c 2 * x * c 2 x c ans += (y - x) * b ans (y - x) * b (y - x) y x b {
                ans += 2 * y * c;
                ans += (x - y) * a;
            } ans += 2 * y * c ans 2 * y * c 2 * y * c 2 y c ans += (x - y) * a ans (x - y) * a (x - y) x y a {
            ans = a * x + b * y;
        } ans = a * x + b * y ans a * x + b * y a * x a x b * y b y 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) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int x = sc.nextInt();
        int y = sc.nextInt();
        int ans = 0;
        if (2 * c < a && 2 * c < b) {
            int p = Math.max(x, y);
            ans = 2 * p * c;
        } else if (2 * c < a) {
            int p = Math.max(0, y - x);
            ans = 2 * x * c + b * p;
        } else if (2 * c < b) {
            int p = Math.max(0, x - y);
            ans = 2 * y * c + a * p;
        } else if (2 * c < a + b) {
            if (x < y) {
                ans += 2 * x * c;
                ans += (y - x) * b;
            } else {
                ans += 2 * y * c;
                ans += (x - y) * a;
            }
        } else {
            ans = a * x + b * y;
        }
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int x = sc.nextInt();
        int y = sc.nextInt();
        int ans = 0;
        if (2 * c < a && 2 * c < b) {
            int p = Math.max(x, y);
            ans = 2 * p * c;
        } else if (2 * c < a) {
            int p = Math.max(0, y - x);
            ans = 2 * x * c + b * p;
        } else if (2 * c < b) {
            int p = Math.max(0, x - y);
            ans = 2 * y * c + a * p;
        } else if (2 * c < a + b) {
            if (x < y) {
                ans += 2 * x * c;
                ans += (y - x) * b;
            } else {
                ans += 2 * y * c;
                ans += (x - y) * a;
            }
        } else {
            ans = a * x + b * y;
        }
        System.out.println(ans);
    }
} Main
import java.util.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int x = sc.nextInt();
        int y = sc.nextInt();
        int ans = 0;
        if (2 * c < a && 2 * c < b) {
            int p = Math.max(x, y);
            ans = 2 * p * c;
        } else if (2 * c < a) {
            int p = Math.max(0, y - x);
            ans = 2 * x * c + b * p;
        } else if (2 * c < b) {
            int p = Math.max(0, x - y);
            ans = 2 * y * c + a * p;
        } else if (2 * c < a + b) {
            if (x < y) {
                ans += 2 * x * c;
                ans += (y - x) * b;
            } else {
                ans += 2 * y * c;
                ans += (x - y) * a;
            }
        } else {
            ans = a * x + b * y;
        }
        System.out.println(ans);
    }
}
