import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) {
        try {
            // 標準入力
            InputStreamReader isr = new InputStreamReader(System.in);
            BufferedReader br = new BufferedReader(isr);
            String strArr[] = br.readLine().split(" ");
            int a = Integer.parseInt(strArr[0]);
            int b = Integer.parseInt(strArr[1]);
            int c = Integer.parseInt(strArr[2]);
            int x = Integer.parseInt(strArr[3]);
            int y = Integer.parseInt(strArr[4]);

            int ans1 = a * x + b * y;

            int ans2 = 0;
            int ans3 = 0;
            if (x > y) {
                ans2 += (c * 2) * y;
                ans3 += (c * 2) * y;
                ans2 += (x - y) * a;
                ans3 += (x - y) * (c * 2);
            } else {
                ans2 += (c * 2) * x;
                ans3 += (c * 2) * x;
                ans2 += (y - x) * b;
                ans3 += (y - x) * (c * 2);
            }

            if (ans1 > ans2) {
                if (ans2 > ans3) {
                    System.out.println(ans3);
                } else {
                    System.out.println(ans2);
                }
            } else {
                if (ans1 > ans3) {
                    System.out.println(ans3);
                } else {
                    System.out.println(ans1);
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    public static void main(String[] args) {
        try {
            // 標準入力
            InputStreamReader isr = new InputStreamReader(System.in);
            BufferedReader br = new BufferedReader(isr);
            String strArr[] = br.readLine().split(" ");
            int a = Integer.parseInt(strArr[0]);
            int b = Integer.parseInt(strArr[1]);
            int c = Integer.parseInt(strArr[2]);
            int x = Integer.parseInt(strArr[3]);
            int y = Integer.parseInt(strArr[4]);

            int ans1 = a * x + b * y;

            int ans2 = 0;
            int ans3 = 0;
            if (x > y) {
                ans2 += (c * 2) * y;
                ans3 += (c * 2) * y;
                ans2 += (x - y) * a;
                ans3 += (x - y) * (c * 2);
            } else {
                ans2 += (c * 2) * x;
                ans3 += (c * 2) * x;
                ans2 += (y - x) * b;
                ans3 += (y - x) * (c * 2);
            }

            if (ans1 > ans2) {
                if (ans2 > ans3) {
                    System.out.println(ans3);
                } else {
                    System.out.println(ans2);
                }
            } else {
                if (ans1 > ans3) {
                    System.out.println(ans3);
                } else {
                    System.out.println(ans1);
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

} Main public static void main(String[] args) {
        try {
            // 標準入力
            InputStreamReader isr = new InputStreamReader(System.in);
            BufferedReader br = new BufferedReader(isr);
            String strArr[] = br.readLine().split(" ");
            int a = Integer.parseInt(strArr[0]);
            int b = Integer.parseInt(strArr[1]);
            int c = Integer.parseInt(strArr[2]);
            int x = Integer.parseInt(strArr[3]);
            int y = Integer.parseInt(strArr[4]);

            int ans1 = a * x + b * y;

            int ans2 = 0;
            int ans3 = 0;
            if (x > y) {
                ans2 += (c * 2) * y;
                ans3 += (c * 2) * y;
                ans2 += (x - y) * a;
                ans3 += (x - y) * (c * 2);
            } else {
                ans2 += (c * 2) * x;
                ans3 += (c * 2) * x;
                ans2 += (y - x) * b;
                ans3 += (y - x) * (c * 2);
            }

            if (ans1 > ans2) {
                if (ans2 > ans3) {
                    System.out.println(ans3);
                } else {
                    System.out.println(ans2);
                }
            } else {
                if (ans1 > ans3) {
                    System.out.println(ans3);
                } else {
                    System.out.println(ans1);
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    } main {
        try {
            // 標準入力
            InputStreamReader isr = new InputStreamReader(System.in);
            BufferedReader br = new BufferedReader(isr);
            String strArr[] = br.readLine().split(" ");
            int a = Integer.parseInt(strArr[0]);
            int b = Integer.parseInt(strArr[1]);
            int c = Integer.parseInt(strArr[2]);
            int x = Integer.parseInt(strArr[3]);
            int y = Integer.parseInt(strArr[4]);

            int ans1 = a * x + b * y;

            int ans2 = 0;
            int ans3 = 0;
            if (x > y) {
                ans2 += (c * 2) * y;
                ans3 += (c * 2) * y;
                ans2 += (x - y) * a;
                ans3 += (x - y) * (c * 2);
            } else {
                ans2 += (c * 2) * x;
                ans3 += (c * 2) * x;
                ans2 += (y - x) * b;
                ans3 += (y - x) * (c * 2);
            }

            if (ans1 > ans2) {
                if (ans2 > ans3) {
                    System.out.println(ans3);
                } else {
                    System.out.println(ans2);
                }
            } else {
                if (ans1 > ans3) {
                    System.out.println(ans3);
                } else {
                    System.out.println(ans1);
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    } try {
            // 標準入力
            InputStreamReader isr = new InputStreamReader(System.in);
            BufferedReader br = new BufferedReader(isr);
            String strArr[] = br.readLine().split(" ");
            int a = Integer.parseInt(strArr[0]);
            int b = Integer.parseInt(strArr[1]);
            int c = Integer.parseInt(strArr[2]);
            int x = Integer.parseInt(strArr[3]);
            int y = Integer.parseInt(strArr[4]);

            int ans1 = a * x + b * y;

            int ans2 = 0;
            int ans3 = 0;
            if (x > y) {
                ans2 += (c * 2) * y;
                ans3 += (c * 2) * y;
                ans2 += (x - y) * a;
                ans3 += (x - y) * (c * 2);
            } else {
                ans2 += (c * 2) * x;
                ans3 += (c * 2) * x;
                ans2 += (y - x) * b;
                ans3 += (y - x) * (c * 2);
            }

            if (ans1 > ans2) {
                if (ans2 > ans3) {
                    System.out.println(ans3);
                } else {
                    System.out.println(ans2);
                }
            } else {
                if (ans1 > ans3) {
                    System.out.println(ans3);
                } else {
                    System.out.println(ans1);
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } IOException e {
            e.printStackTrace();
        } e.printStackTrace() e.printStackTrace e {
            // 標準入力
            InputStreamReader isr = new InputStreamReader(System.in);
            BufferedReader br = new BufferedReader(isr);
            String strArr[] = br.readLine().split(" ");
            int a = Integer.parseInt(strArr[0]);
            int b = Integer.parseInt(strArr[1]);
            int c = Integer.parseInt(strArr[2]);
            int x = Integer.parseInt(strArr[3]);
            int y = Integer.parseInt(strArr[4]);

            int ans1 = a * x + b * y;

            int ans2 = 0;
            int ans3 = 0;
            if (x > y) {
                ans2 += (c * 2) * y;
                ans3 += (c * 2) * y;
                ans2 += (x - y) * a;
                ans3 += (x - y) * (c * 2);
            } else {
                ans2 += (c * 2) * x;
                ans3 += (c * 2) * x;
                ans2 += (y - x) * b;
                ans3 += (y - x) * (c * 2);
            }

            if (ans1 > ans2) {
                if (ans2 > ans3) {
                    System.out.println(ans3);
                } else {
                    System.out.println(ans2);
                }
            } else {
                if (ans1 > ans3) {
                    System.out.println(ans3);
                } else {
                    System.out.println(ans1);
                }
            }
        } InputStreamReader isr = new InputStreamReader(System.in); isr new InputStreamReader(System.in) BufferedReader br = new BufferedReader(isr); br new BufferedReader(isr) String strArr[] = br.readLine().split(" "); strArr br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int a = Integer.parseInt(strArr[0]); a Integer.parseInt(strArr[0]) Integer.parseInt Integer strArr[0] strArr 0 int b = Integer.parseInt(strArr[1]); b Integer.parseInt(strArr[1]) Integer.parseInt Integer strArr[1] strArr 1 int c = Integer.parseInt(strArr[2]); c Integer.parseInt(strArr[2]) Integer.parseInt Integer strArr[2] strArr 2 int x = Integer.parseInt(strArr[3]); x Integer.parseInt(strArr[3]) Integer.parseInt Integer strArr[3] strArr 3 int y = Integer.parseInt(strArr[4]); y Integer.parseInt(strArr[4]) Integer.parseInt Integer strArr[4] strArr 4 int ans1 = a * x + b * y; ans1 a * x + b * y a * x a x b * y b y int ans2 = 0; ans2 0 int ans3 = 0; ans3 0 if (x > y) {
                ans2 += (c * 2) * y;
                ans3 += (c * 2) * y;
                ans2 += (x - y) * a;
                ans3 += (x - y) * (c * 2);
            } else {
                ans2 += (c * 2) * x;
                ans3 += (c * 2) * x;
                ans2 += (y - x) * b;
                ans3 += (y - x) * (c * 2);
            } x > y x y {
                ans2 += (c * 2) * y;
                ans3 += (c * 2) * y;
                ans2 += (x - y) * a;
                ans3 += (x - y) * (c * 2);
            } ans2 += (c * 2) * y ans2 (c * 2) * y (c * 2) c 2 y ans3 += (c * 2) * y ans3 (c * 2) * y (c * 2) c 2 y ans2 += (x - y) * a ans2 (x - y) * a (x - y) x y a ans3 += (x - y) * (c * 2) ans3 (x - y) * (c * 2) (x - y) x y (c * 2) c 2 {
                ans2 += (c * 2) * x;
                ans3 += (c * 2) * x;
                ans2 += (y - x) * b;
                ans3 += (y - x) * (c * 2);
            } ans2 += (c * 2) * x ans2 (c * 2) * x (c * 2) c 2 x ans3 += (c * 2) * x ans3 (c * 2) * x (c * 2) c 2 x ans2 += (y - x) * b ans2 (y - x) * b (y - x) y x b ans3 += (y - x) * (c * 2) ans3 (y - x) * (c * 2) (y - x) y x (c * 2) c 2 if (ans1 > ans2) {
                if (ans2 > ans3) {
                    System.out.println(ans3);
                } else {
                    System.out.println(ans2);
                }
            } else {
                if (ans1 > ans3) {
                    System.out.println(ans3);
                } else {
                    System.out.println(ans1);
                }
            } ans1 > ans2 ans1 ans2 {
                if (ans2 > ans3) {
                    System.out.println(ans3);
                } else {
                    System.out.println(ans2);
                }
            } if (ans2 > ans3) {
                    System.out.println(ans3);
                } else {
                    System.out.println(ans2);
                } ans2 > ans3 ans2 ans3 {
                    System.out.println(ans3);
                } System.out.println(ans3) System.out.println System.out System System.out ans3 {
                    System.out.println(ans2);
                } System.out.println(ans2) System.out.println System.out System System.out ans2 {
                if (ans1 > ans3) {
                    System.out.println(ans3);
                } else {
                    System.out.println(ans1);
                }
            } if (ans1 > ans3) {
                    System.out.println(ans3);
                } else {
                    System.out.println(ans1);
                } ans1 > ans3 ans1 ans3 {
                    System.out.println(ans3);
                } System.out.println(ans3) System.out.println System.out System System.out ans3 {
                    System.out.println(ans1);
                } System.out.println(ans1) System.out.println System.out System System.out ans1 String[] args args public class Main {
    public static void main(String[] args) {
        try {
            // 標準入力
            InputStreamReader isr = new InputStreamReader(System.in);
            BufferedReader br = new BufferedReader(isr);
            String strArr[] = br.readLine().split(" ");
            int a = Integer.parseInt(strArr[0]);
            int b = Integer.parseInt(strArr[1]);
            int c = Integer.parseInt(strArr[2]);
            int x = Integer.parseInt(strArr[3]);
            int y = Integer.parseInt(strArr[4]);

            int ans1 = a * x + b * y;

            int ans2 = 0;
            int ans3 = 0;
            if (x > y) {
                ans2 += (c * 2) * y;
                ans3 += (c * 2) * y;
                ans2 += (x - y) * a;
                ans3 += (x - y) * (c * 2);
            } else {
                ans2 += (c * 2) * x;
                ans3 += (c * 2) * x;
                ans2 += (y - x) * b;
                ans3 += (y - x) * (c * 2);
            }

            if (ans1 > ans2) {
                if (ans2 > ans3) {
                    System.out.println(ans3);
                } else {
                    System.out.println(ans2);
                }
            } else {
                if (ans1 > ans3) {
                    System.out.println(ans3);
                } else {
                    System.out.println(ans1);
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

} public class Main {
    public static void main(String[] args) {
        try {
            // 標準入力
            InputStreamReader isr = new InputStreamReader(System.in);
            BufferedReader br = new BufferedReader(isr);
            String strArr[] = br.readLine().split(" ");
            int a = Integer.parseInt(strArr[0]);
            int b = Integer.parseInt(strArr[1]);
            int c = Integer.parseInt(strArr[2]);
            int x = Integer.parseInt(strArr[3]);
            int y = Integer.parseInt(strArr[4]);

            int ans1 = a * x + b * y;

            int ans2 = 0;
            int ans3 = 0;
            if (x > y) {
                ans2 += (c * 2) * y;
                ans3 += (c * 2) * y;
                ans2 += (x - y) * a;
                ans3 += (x - y) * (c * 2);
            } else {
                ans2 += (c * 2) * x;
                ans3 += (c * 2) * x;
                ans2 += (y - x) * b;
                ans3 += (y - x) * (c * 2);
            }

            if (ans1 > ans2) {
                if (ans2 > ans3) {
                    System.out.println(ans3);
                } else {
                    System.out.println(ans2);
                }
            } else {
                if (ans1 > ans3) {
                    System.out.println(ans3);
                } else {
                    System.out.println(ans1);
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) {
        try {
            // 標準入力
            InputStreamReader isr = new InputStreamReader(System.in);
            BufferedReader br = new BufferedReader(isr);
            String strArr[] = br.readLine().split(" ");
            int a = Integer.parseInt(strArr[0]);
            int b = Integer.parseInt(strArr[1]);
            int c = Integer.parseInt(strArr[2]);
            int x = Integer.parseInt(strArr[3]);
            int y = Integer.parseInt(strArr[4]);

            int ans1 = a * x + b * y;

            int ans2 = 0;
            int ans3 = 0;
            if (x > y) {
                ans2 += (c * 2) * y;
                ans3 += (c * 2) * y;
                ans2 += (x - y) * a;
                ans3 += (x - y) * (c * 2);
            } else {
                ans2 += (c * 2) * x;
                ans3 += (c * 2) * x;
                ans2 += (y - x) * b;
                ans3 += (y - x) * (c * 2);
            }

            if (ans1 > ans2) {
                if (ans2 > ans3) {
                    System.out.println(ans3);
                } else {
                    System.out.println(ans2);
                }
            } else {
                if (ans1 > ans3) {
                    System.out.println(ans3);
                } else {
                    System.out.println(ans1);
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
