import java.util.*;
public class Main {
  public static void main(String[] args) {
    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();
    // まずx, y を単体で用意する
    long costs = x * a + y * b;
    long ans = costs;
    for (int i = 1; i <= Math.min(x, y); i++) {
      costs = costs - a - b + (c * 2);
      ans = Math.min(ans, costs);
    }
    for (int j = 1; j <= Math.abs(x - y); j++) {
      if (x > y) {
        costs = costs + (c * 2) - a;
      } else {
        costs = costs + (c * 2) - b;
      }
      ans = Math.min(ans, costs);
    }
    System.out.println(ans);
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    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();
    // まずx, y を単体で用意する
    long costs = x * a + y * b;
    long ans = costs;
    for (int i = 1; i <= Math.min(x, y); i++) {
      costs = costs - a - b + (c * 2);
      ans = Math.min(ans, costs);
    }
    for (int j = 1; j <= Math.abs(x - y); j++) {
      if (x > y) {
        costs = costs + (c * 2) - a;
      } else {
        costs = costs + (c * 2) - b;
      }
      ans = Math.min(ans, costs);
    }
    System.out.println(ans);
  }
} Main public static void main(String[] args) {
    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();
    // まずx, y を単体で用意する
    long costs = x * a + y * b;
    long ans = costs;
    for (int i = 1; i <= Math.min(x, y); i++) {
      costs = costs - a - b + (c * 2);
      ans = Math.min(ans, costs);
    }
    for (int j = 1; j <= Math.abs(x - y); j++) {
      if (x > y) {
        costs = costs + (c * 2) - a;
      } else {
        costs = costs + (c * 2) - b;
      }
      ans = Math.min(ans, costs);
    }
    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();
    // まずx, y を単体で用意する
    long costs = x * a + y * b;
    long ans = costs;
    for (int i = 1; i <= Math.min(x, y); i++) {
      costs = costs - a - b + (c * 2);
      ans = Math.min(ans, costs);
    }
    for (int j = 1; j <= Math.abs(x - y); j++) {
      if (x > y) {
        costs = costs + (c * 2) - a;
      } else {
        costs = costs + (c * 2) - b;
      }
      ans = Math.min(ans, costs);
    }
    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 long costs = x * a + y * b; costs x * a + y * b x * a x a y * b y b long ans = costs; ans costs for (int i = 1; i <= Math.min(x, y); i++) {
      costs = costs - a - b + (c * 2);
      ans = Math.min(ans, costs);
    } int i = 1; int i = 1; i 1 i <= Math.min(x, y) i Math.min(x, y) Math.min Math x y i++ i++ i {
      costs = costs - a - b + (c * 2);
      ans = Math.min(ans, costs);
    } {
      costs = costs - a - b + (c * 2);
      ans = Math.min(ans, costs);
    } costs = costs - a - b + (c * 2) costs costs - a - b + (c * 2) costs - a - b costs - a - b costs a b (c * 2) c 2 ans = Math.min(ans, costs) ans Math.min(ans, costs) Math.min Math ans costs for (int j = 1; j <= Math.abs(x - y); j++) {
      if (x > y) {
        costs = costs + (c * 2) - a;
      } else {
        costs = costs + (c * 2) - b;
      }
      ans = Math.min(ans, costs);
    } int j = 1; int j = 1; j 1 j <= Math.abs(x - y) j Math.abs(x - y) Math.abs Math x - y x y j++ j++ j {
      if (x > y) {
        costs = costs + (c * 2) - a;
      } else {
        costs = costs + (c * 2) - b;
      }
      ans = Math.min(ans, costs);
    } {
      if (x > y) {
        costs = costs + (c * 2) - a;
      } else {
        costs = costs + (c * 2) - b;
      }
      ans = Math.min(ans, costs);
    } if (x > y) {
        costs = costs + (c * 2) - a;
      } else {
        costs = costs + (c * 2) - b;
      } x > y x y {
        costs = costs + (c * 2) - a;
      } costs = costs + (c * 2) - a costs costs + (c * 2) - a costs + (c * 2) costs (c * 2) c 2 a {
        costs = costs + (c * 2) - b;
      } costs = costs + (c * 2) - b costs costs + (c * 2) - b costs + (c * 2) costs (c * 2) c 2 b ans = Math.min(ans, costs) ans Math.min(ans, costs) Math.min Math ans costs 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) {
    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();
    // まずx, y を単体で用意する
    long costs = x * a + y * b;
    long ans = costs;
    for (int i = 1; i <= Math.min(x, y); i++) {
      costs = costs - a - b + (c * 2);
      ans = Math.min(ans, costs);
    }
    for (int j = 1; j <= Math.abs(x - y); j++) {
      if (x > y) {
        costs = costs + (c * 2) - a;
      } else {
        costs = costs + (c * 2) - b;
      }
      ans = Math.min(ans, costs);
    }
    System.out.println(ans);
  }
} public class Main {
  public static void main(String[] args) {
    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();
    // まずx, y を単体で用意する
    long costs = x * a + y * b;
    long ans = costs;
    for (int i = 1; i <= Math.min(x, y); i++) {
      costs = costs - a - b + (c * 2);
      ans = Math.min(ans, costs);
    }
    for (int j = 1; j <= Math.abs(x - y); j++) {
      if (x > y) {
        costs = costs + (c * 2) - a;
      } else {
        costs = costs + (c * 2) - b;
      }
      ans = Math.min(ans, costs);
    }
    System.out.println(ans);
  }
} Main
import java.util.*;
public class Main {
  public static void main(String[] args) {
    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();
    // まずx, y を単体で用意する
    long costs = x * a + y * b;
    long ans = costs;
    for (int i = 1; i <= Math.min(x, y); i++) {
      costs = costs - a - b + (c * 2);
      ans = Math.min(ans, costs);
    }
    for (int j = 1; j <= Math.abs(x - y); j++) {
      if (x > y) {
        costs = costs + (c * 2) - a;
      } else {
        costs = costs + (c * 2) - b;
      }
      ans = Math.min(ans, costs);
    }
    System.out.println(ans);
  }
}
