import java.util.Scanner;

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

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

      long ans_1 = 0L;
      long ans_2 = 0L;
      long tmp_1 = 0L;
      long tmp_2 = 0L;

      ans_1 = a*x + b*y;

      if(a < b) {
        ans_2 += c*y*2;
        if(x >= y) {
          ans_2 += (x-y)*a;
        }
      } else if (b > a) {
        ans_2 += c*x*2;
        if(y >= x) {
          ans_2 += (y-x)*b;
        }
      } else {
        tmp_1 += c*y*2;
        if(x > y) {
          tmp_1 += (x-y)*a;
        }
        tmp_2 += c*x*2;
        if(y > x) {
          tmp_2 += (y-x)*b;
        }
        ans_2 = Math.min(tmp_2,tmp_1);
      }

      System.out.println(Math.min(ans_1,ans_2));
  }
} import java.util.Scanner; Scanner java.util public class Main {
  public static void main (String[] args) {
      Scanner sc = new Scanner(System.in);

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

      long ans_1 = 0L;
      long ans_2 = 0L;
      long tmp_1 = 0L;
      long tmp_2 = 0L;

      ans_1 = a*x + b*y;

      if(a < b) {
        ans_2 += c*y*2;
        if(x >= y) {
          ans_2 += (x-y)*a;
        }
      } else if (b > a) {
        ans_2 += c*x*2;
        if(y >= x) {
          ans_2 += (y-x)*b;
        }
      } else {
        tmp_1 += c*y*2;
        if(x > y) {
          tmp_1 += (x-y)*a;
        }
        tmp_2 += c*x*2;
        if(y > x) {
          tmp_2 += (y-x)*b;
        }
        ans_2 = Math.min(tmp_2,tmp_1);
      }

      System.out.println(Math.min(ans_1,ans_2));
  }
} Main public static void main (String[] args) {
      Scanner sc = new Scanner(System.in);

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

      long ans_1 = 0L;
      long ans_2 = 0L;
      long tmp_1 = 0L;
      long tmp_2 = 0L;

      ans_1 = a*x + b*y;

      if(a < b) {
        ans_2 += c*y*2;
        if(x >= y) {
          ans_2 += (x-y)*a;
        }
      } else if (b > a) {
        ans_2 += c*x*2;
        if(y >= x) {
          ans_2 += (y-x)*b;
        }
      } else {
        tmp_1 += c*y*2;
        if(x > y) {
          tmp_1 += (x-y)*a;
        }
        tmp_2 += c*x*2;
        if(y > x) {
          tmp_2 += (y-x)*b;
        }
        ans_2 = Math.min(tmp_2,tmp_1);
      }

      System.out.println(Math.min(ans_1,ans_2));
  } main {
      Scanner sc = new Scanner(System.in);

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

      long ans_1 = 0L;
      long ans_2 = 0L;
      long tmp_1 = 0L;
      long tmp_2 = 0L;

      ans_1 = a*x + b*y;

      if(a < b) {
        ans_2 += c*y*2;
        if(x >= y) {
          ans_2 += (x-y)*a;
        }
      } else if (b > a) {
        ans_2 += c*x*2;
        if(y >= x) {
          ans_2 += (y-x)*b;
        }
      } else {
        tmp_1 += c*y*2;
        if(x > y) {
          tmp_1 += (x-y)*a;
        }
        tmp_2 += c*x*2;
        if(y > x) {
          tmp_2 += (y-x)*b;
        }
        ans_2 = Math.min(tmp_2,tmp_1);
      }

      System.out.println(Math.min(ans_1,ans_2));
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long a = sc.nextInt(); a sc.nextInt() sc.nextInt sc long b = sc.nextInt(); b sc.nextInt() sc.nextInt sc long c = sc.nextInt(); c sc.nextInt() sc.nextInt sc long x = sc.nextInt(); x sc.nextInt() sc.nextInt sc long y = sc.nextInt(); y sc.nextInt() sc.nextInt sc long ans_1 = 0L; ans_1 0L long ans_2 = 0L; ans_2 0L long tmp_1 = 0L; tmp_1 0L long tmp_2 = 0L; tmp_2 0L ans_1 = a*x + b*y ans_1 a*x + b*y a*x a x b*y b y if(a < b) {
        ans_2 += c*y*2;
        if(x >= y) {
          ans_2 += (x-y)*a;
        }
      } else if (b > a) {
        ans_2 += c*x*2;
        if(y >= x) {
          ans_2 += (y-x)*b;
        }
      } else {
        tmp_1 += c*y*2;
        if(x > y) {
          tmp_1 += (x-y)*a;
        }
        tmp_2 += c*x*2;
        if(y > x) {
          tmp_2 += (y-x)*b;
        }
        ans_2 = Math.min(tmp_2,tmp_1);
      } a < b a b {
        ans_2 += c*y*2;
        if(x >= y) {
          ans_2 += (x-y)*a;
        }
      } ans_2 += c*y*2 ans_2 c*y*2 c*y*2 c y 2 if(x >= y) {
          ans_2 += (x-y)*a;
        } x >= y x y {
          ans_2 += (x-y)*a;
        } ans_2 += (x-y)*a ans_2 (x-y)*a (x-y) x y a if (b > a) {
        ans_2 += c*x*2;
        if(y >= x) {
          ans_2 += (y-x)*b;
        }
      } else {
        tmp_1 += c*y*2;
        if(x > y) {
          tmp_1 += (x-y)*a;
        }
        tmp_2 += c*x*2;
        if(y > x) {
          tmp_2 += (y-x)*b;
        }
        ans_2 = Math.min(tmp_2,tmp_1);
      } b > a b a {
        ans_2 += c*x*2;
        if(y >= x) {
          ans_2 += (y-x)*b;
        }
      } ans_2 += c*x*2 ans_2 c*x*2 c*x*2 c x 2 if(y >= x) {
          ans_2 += (y-x)*b;
        } y >= x y x {
          ans_2 += (y-x)*b;
        } ans_2 += (y-x)*b ans_2 (y-x)*b (y-x) y x b {
        tmp_1 += c*y*2;
        if(x > y) {
          tmp_1 += (x-y)*a;
        }
        tmp_2 += c*x*2;
        if(y > x) {
          tmp_2 += (y-x)*b;
        }
        ans_2 = Math.min(tmp_2,tmp_1);
      } tmp_1 += c*y*2 tmp_1 c*y*2 c*y*2 c y 2 if(x > y) {
          tmp_1 += (x-y)*a;
        } x > y x y {
          tmp_1 += (x-y)*a;
        } tmp_1 += (x-y)*a tmp_1 (x-y)*a (x-y) x y a tmp_2 += c*x*2 tmp_2 c*x*2 c*x*2 c x 2 if(y > x) {
          tmp_2 += (y-x)*b;
        } y > x y x {
          tmp_2 += (y-x)*b;
        } tmp_2 += (y-x)*b tmp_2 (y-x)*b (y-x) y x b ans_2 = Math.min(tmp_2,tmp_1) ans_2 Math.min(tmp_2,tmp_1) Math.min Math tmp_2 tmp_1 System.out.println(Math.min(ans_1,ans_2)) System.out.println System.out System System.out Math.min(ans_1,ans_2) Math.min Math ans_1 ans_2 String[] args args public class Main {
  public static void main (String[] args) {
      Scanner sc = new Scanner(System.in);

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

      long ans_1 = 0L;
      long ans_2 = 0L;
      long tmp_1 = 0L;
      long tmp_2 = 0L;

      ans_1 = a*x + b*y;

      if(a < b) {
        ans_2 += c*y*2;
        if(x >= y) {
          ans_2 += (x-y)*a;
        }
      } else if (b > a) {
        ans_2 += c*x*2;
        if(y >= x) {
          ans_2 += (y-x)*b;
        }
      } else {
        tmp_1 += c*y*2;
        if(x > y) {
          tmp_1 += (x-y)*a;
        }
        tmp_2 += c*x*2;
        if(y > x) {
          tmp_2 += (y-x)*b;
        }
        ans_2 = Math.min(tmp_2,tmp_1);
      }

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

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

      long ans_1 = 0L;
      long ans_2 = 0L;
      long tmp_1 = 0L;
      long tmp_2 = 0L;

      ans_1 = a*x + b*y;

      if(a < b) {
        ans_2 += c*y*2;
        if(x >= y) {
          ans_2 += (x-y)*a;
        }
      } else if (b > a) {
        ans_2 += c*x*2;
        if(y >= x) {
          ans_2 += (y-x)*b;
        }
      } else {
        tmp_1 += c*y*2;
        if(x > y) {
          tmp_1 += (x-y)*a;
        }
        tmp_2 += c*x*2;
        if(y > x) {
          tmp_2 += (y-x)*b;
        }
        ans_2 = Math.min(tmp_2,tmp_1);
      }

      System.out.println(Math.min(ans_1,ans_2));
  }
} Main
import java.util.Scanner;

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

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

      long ans_1 = 0L;
      long ans_2 = 0L;
      long tmp_1 = 0L;
      long tmp_2 = 0L;

      ans_1 = a*x + b*y;

      if(a < b) {
        ans_2 += c*y*2;
        if(x >= y) {
          ans_2 += (x-y)*a;
        }
      } else if (b > a) {
        ans_2 += c*x*2;
        if(y >= x) {
          ans_2 += (y-x)*b;
        }
      } else {
        tmp_1 += c*y*2;
        if(x > y) {
          tmp_1 += (x-y)*a;
        }
        tmp_2 += c*x*2;
        if(y > x) {
          tmp_2 += (y-x)*b;
        }
        ans_2 = Math.min(tmp_2,tmp_1);
      }

      System.out.println(Math.min(ans_1,ans_2));
  }
}