import java.util.Scanner;
 
class Main{
  public static void main(String args[]){
    Scanner scanner = new Scanner(System.in);
 
    int a = scanner.nextInt();
    int b = scanner.nextInt();
    int c = scanner.nextInt();
    int x = scanner.nextInt();
    int y = scanner.nextInt();
    int sum = 0;
 
    if(a + b < c * 2){
      sum = a * x + b * y;
      System.out.println(sum);
    }else{
      while(x >= 1 && y >= 1){
        sum += c * 2;
        x--;
        y--;
      }
      int sum2 = sum;
      sum += a * x + b * y;
      if(a > c * 2 || b > c * 2){
        while(x >= 1 || y >= 1){
          sum2 += c * 2;
          x--;
          y--;
        }
        x = 0;
        y = 0;
      }
      sum2 += a * x + b * y;
      if(sum < sum2){
        System.out.println(sum);
      }else{
        System.out.println(sum2);
      }
    }
  }
} import java.util.Scanner; Scanner java.util class Main{
  public static void main(String args[]){
    Scanner scanner = new Scanner(System.in);
 
    int a = scanner.nextInt();
    int b = scanner.nextInt();
    int c = scanner.nextInt();
    int x = scanner.nextInt();
    int y = scanner.nextInt();
    int sum = 0;
 
    if(a + b < c * 2){
      sum = a * x + b * y;
      System.out.println(sum);
    }else{
      while(x >= 1 && y >= 1){
        sum += c * 2;
        x--;
        y--;
      }
      int sum2 = sum;
      sum += a * x + b * y;
      if(a > c * 2 || b > c * 2){
        while(x >= 1 || y >= 1){
          sum2 += c * 2;
          x--;
          y--;
        }
        x = 0;
        y = 0;
      }
      sum2 += a * x + b * y;
      if(sum < sum2){
        System.out.println(sum);
      }else{
        System.out.println(sum2);
      }
    }
  }
} Main public static void main(String args[]){
    Scanner scanner = new Scanner(System.in);
 
    int a = scanner.nextInt();
    int b = scanner.nextInt();
    int c = scanner.nextInt();
    int x = scanner.nextInt();
    int y = scanner.nextInt();
    int sum = 0;
 
    if(a + b < c * 2){
      sum = a * x + b * y;
      System.out.println(sum);
    }else{
      while(x >= 1 && y >= 1){
        sum += c * 2;
        x--;
        y--;
      }
      int sum2 = sum;
      sum += a * x + b * y;
      if(a > c * 2 || b > c * 2){
        while(x >= 1 || y >= 1){
          sum2 += c * 2;
          x--;
          y--;
        }
        x = 0;
        y = 0;
      }
      sum2 += a * x + b * y;
      if(sum < sum2){
        System.out.println(sum);
      }else{
        System.out.println(sum2);
      }
    }
  } main {
    Scanner scanner = new Scanner(System.in);
 
    int a = scanner.nextInt();
    int b = scanner.nextInt();
    int c = scanner.nextInt();
    int x = scanner.nextInt();
    int y = scanner.nextInt();
    int sum = 0;
 
    if(a + b < c * 2){
      sum = a * x + b * y;
      System.out.println(sum);
    }else{
      while(x >= 1 && y >= 1){
        sum += c * 2;
        x--;
        y--;
      }
      int sum2 = sum;
      sum += a * x + b * y;
      if(a > c * 2 || b > c * 2){
        while(x >= 1 || y >= 1){
          sum2 += c * 2;
          x--;
          y--;
        }
        x = 0;
        y = 0;
      }
      sum2 += a * x + b * y;
      if(sum < sum2){
        System.out.println(sum);
      }else{
        System.out.println(sum2);
      }
    }
  } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int a = scanner.nextInt(); a scanner.nextInt() scanner.nextInt scanner int b = scanner.nextInt(); b scanner.nextInt() scanner.nextInt scanner int c = scanner.nextInt(); c scanner.nextInt() scanner.nextInt scanner int x = scanner.nextInt(); x scanner.nextInt() scanner.nextInt scanner int y = scanner.nextInt(); y scanner.nextInt() scanner.nextInt scanner int sum = 0; sum 0 if(a + b < c * 2){
      sum = a * x + b * y;
      System.out.println(sum);
    }else{
      while(x >= 1 && y >= 1){
        sum += c * 2;
        x--;
        y--;
      }
      int sum2 = sum;
      sum += a * x + b * y;
      if(a > c * 2 || b > c * 2){
        while(x >= 1 || y >= 1){
          sum2 += c * 2;
          x--;
          y--;
        }
        x = 0;
        y = 0;
      }
      sum2 += a * x + b * y;
      if(sum < sum2){
        System.out.println(sum);
      }else{
        System.out.println(sum2);
      }
    } a + b < c * 2 a + b a b c * 2 c 2 {
      sum = a * x + b * y;
      System.out.println(sum);
    } sum = a * x + b * y sum a * x + b * y a * x a x b * y b y System.out.println(sum) System.out.println System.out System System.out sum {
      while(x >= 1 && y >= 1){
        sum += c * 2;
        x--;
        y--;
      }
      int sum2 = sum;
      sum += a * x + b * y;
      if(a > c * 2 || b > c * 2){
        while(x >= 1 || y >= 1){
          sum2 += c * 2;
          x--;
          y--;
        }
        x = 0;
        y = 0;
      }
      sum2 += a * x + b * y;
      if(sum < sum2){
        System.out.println(sum);
      }else{
        System.out.println(sum2);
      }
    } while(x >= 1 && y >= 1){
        sum += c * 2;
        x--;
        y--;
      } x >= 1 && y >= 1 x >= 1 x 1 y >= 1 y 1 {
        sum += c * 2;
        x--;
        y--;
      } sum += c * 2 sum c * 2 c 2 x-- x y-- y int sum2 = sum; sum2 sum sum += a * x + b * y sum a * x + b * y a * x a x b * y b y if(a > c * 2 || b > c * 2){
        while(x >= 1 || y >= 1){
          sum2 += c * 2;
          x--;
          y--;
        }
        x = 0;
        y = 0;
      } a > c * 2 || b > c * 2 a > c * 2 a c * 2 c 2 b > c * 2 b c * 2 c 2 {
        while(x >= 1 || y >= 1){
          sum2 += c * 2;
          x--;
          y--;
        }
        x = 0;
        y = 0;
      } while(x >= 1 || y >= 1){
          sum2 += c * 2;
          x--;
          y--;
        } x >= 1 || y >= 1 x >= 1 x 1 y >= 1 y 1 {
          sum2 += c * 2;
          x--;
          y--;
        } sum2 += c * 2 sum2 c * 2 c 2 x-- x y-- y x = 0 x 0 y = 0 y 0 sum2 += a * x + b * y sum2 a * x + b * y a * x a x b * y b y if(sum < sum2){
        System.out.println(sum);
      }else{
        System.out.println(sum2);
      } sum < sum2 sum sum2 {
        System.out.println(sum);
      } System.out.println(sum) System.out.println System.out System System.out sum {
        System.out.println(sum2);
      } System.out.println(sum2) System.out.println System.out System System.out sum2 String args[] args
import java.util.Scanner;
 
class Main{
  public static void main(String args[]){
    Scanner scanner = new Scanner(System.in);
 
    int a = scanner.nextInt();
    int b = scanner.nextInt();
    int c = scanner.nextInt();
    int x = scanner.nextInt();
    int y = scanner.nextInt();
    int sum = 0;
 
    if(a + b < c * 2){
      sum = a * x + b * y;
      System.out.println(sum);
    }else{
      while(x >= 1 && y >= 1){
        sum += c * 2;
        x--;
        y--;
      }
      int sum2 = sum;
      sum += a * x + b * y;
      if(a > c * 2 || b > c * 2){
        while(x >= 1 || y >= 1){
          sum2 += c * 2;
          x--;
          y--;
        }
        x = 0;
        y = 0;
      }
      sum2 += a * x + b * y;
      if(sum < sum2){
        System.out.println(sum);
      }else{
        System.out.println(sum2);
      }
    }
  }
}