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

public class Main {

  public static void main(String[] args) {
    new Main().run();
  }

  public void run() {

    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {

      String[] lines = in.readLine().split(" ");
      int[] params = new int[lines.length];
      int k=0;
      for (String s : lines) {
        params[k++] = Integer.parseInt(s);
      }

      int ans = Integer.MAX_VALUE;
      int max = params[3] + params[4];
      for(int i=0; i<max; i++) {
        int t = 2 * params[2] * i
          + Math.max(params[3] - i, 0) * params[0]
          + Math.max(params[4] - i, 0) * params[1];
        ans = Math.min(ans, t);
      }

      System.out.println(ans);

    }
    catch(IOException e) {
      System.err.println(e);
    }
  }
} 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) {
    new Main().run();
  }

  public void run() {

    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {

      String[] lines = in.readLine().split(" ");
      int[] params = new int[lines.length];
      int k=0;
      for (String s : lines) {
        params[k++] = Integer.parseInt(s);
      }

      int ans = Integer.MAX_VALUE;
      int max = params[3] + params[4];
      for(int i=0; i<max; i++) {
        int t = 2 * params[2] * i
          + Math.max(params[3] - i, 0) * params[0]
          + Math.max(params[4] - i, 0) * params[1];
        ans = Math.min(ans, t);
      }

      System.out.println(ans);

    }
    catch(IOException e) {
      System.err.println(e);
    }
  }
} Main public static void main(String[] args) {
    new Main().run();
  } main {
    new Main().run();
  } new Main().run() new Main().run new Main() String[] args args public void run() {

    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {

      String[] lines = in.readLine().split(" ");
      int[] params = new int[lines.length];
      int k=0;
      for (String s : lines) {
        params[k++] = Integer.parseInt(s);
      }

      int ans = Integer.MAX_VALUE;
      int max = params[3] + params[4];
      for(int i=0; i<max; i++) {
        int t = 2 * params[2] * i
          + Math.max(params[3] - i, 0) * params[0]
          + Math.max(params[4] - i, 0) * params[1];
        ans = Math.min(ans, t);
      }

      System.out.println(ans);

    }
    catch(IOException e) {
      System.err.println(e);
    }
  } run {

    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {

      String[] lines = in.readLine().split(" ");
      int[] params = new int[lines.length];
      int k=0;
      for (String s : lines) {
        params[k++] = Integer.parseInt(s);
      }

      int ans = Integer.MAX_VALUE;
      int max = params[3] + params[4];
      for(int i=0; i<max; i++) {
        int t = 2 * params[2] * i
          + Math.max(params[3] - i, 0) * params[0]
          + Math.max(params[4] - i, 0) * params[1];
        ans = Math.min(ans, t);
      }

      System.out.println(ans);

    }
    catch(IOException e) {
      System.err.println(e);
    }
  } try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {

      String[] lines = in.readLine().split(" ");
      int[] params = new int[lines.length];
      int k=0;
      for (String s : lines) {
        params[k++] = Integer.parseInt(s);
      }

      int ans = Integer.MAX_VALUE;
      int max = params[3] + params[4];
      for(int i=0; i<max; i++) {
        int t = 2 * params[2] * i
          + Math.max(params[3] - i, 0) * params[0]
          + Math.max(params[4] - i, 0) * params[1];
        ans = Math.min(ans, t);
      }

      System.out.println(ans);

    }
    catch(IOException e) {
      System.err.println(e);
    } catch(IOException e) {
      System.err.println(e);
    } IOException e {
      System.err.println(e);
    } System.err.println(e) System.err.println System.err System System.err e {

      String[] lines = in.readLine().split(" ");
      int[] params = new int[lines.length];
      int k=0;
      for (String s : lines) {
        params[k++] = Integer.parseInt(s);
      }

      int ans = Integer.MAX_VALUE;
      int max = params[3] + params[4];
      for(int i=0; i<max; i++) {
        int t = 2 * params[2] * i
          + Math.max(params[3] - i, 0) * params[0]
          + Math.max(params[4] - i, 0) * params[1];
        ans = Math.min(ans, t);
      }

      System.out.println(ans);

    } BufferedReader in = new BufferedReader(new InputStreamReader(System.in)) BufferedReader in = new BufferedReader(new InputStreamReader(System.in)) new BufferedReader(new InputStreamReader(System.in)) String[] lines = in.readLine().split(" "); lines in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " int[] params = new int[lines.length]; params new int[lines.length] lines.length lines lines.length int k=0; k 0 for (String s : lines) {
        params[k++] = Integer.parseInt(s);
      } String s lines {
        params[k++] = Integer.parseInt(s);
      } {
        params[k++] = Integer.parseInt(s);
      } params[k++] = Integer.parseInt(s) params[k++] params k++ k Integer.parseInt(s) Integer.parseInt Integer s int ans = Integer.MAX_VALUE; ans Integer.MAX_VALUE Integer Integer.MAX_VALUE int max = params[3] + params[4]; max params[3] + params[4] params[3] params 3 params[4] params 4 for(int i=0; i<max; i++) {
        int t = 2 * params[2] * i
          + Math.max(params[3] - i, 0) * params[0]
          + Math.max(params[4] - i, 0) * params[1];
        ans = Math.min(ans, t);
      } int i=0; int i=0; i 0 i<max i max i++ i++ i {
        int t = 2 * params[2] * i
          + Math.max(params[3] - i, 0) * params[0]
          + Math.max(params[4] - i, 0) * params[1];
        ans = Math.min(ans, t);
      } {
        int t = 2 * params[2] * i
          + Math.max(params[3] - i, 0) * params[0]
          + Math.max(params[4] - i, 0) * params[1];
        ans = Math.min(ans, t);
      } int t = 2 * params[2] * i
          + Math.max(params[3] - i, 0) * params[0]
          + Math.max(params[4] - i, 0) * params[1]; t 2 * params[2] * i
          + Math.max(params[3] - i, 0) * params[0]
          + Math.max(params[4] - i, 0) * params[1] 2 * params[2] * i
          + Math.max(params[3] - i, 0) * params[0]
          + Math.max(params[4] - i, 0) * params[1] 2 * params[2] * i 2 * params[2] * i 2 params[2] params 2 i Math.max(params[3] - i, 0) * params[0] Math.max(params[3] - i, 0) Math.max Math params[3] - i params[3] params 3 i 0 params[0] params 0 Math.max(params[4] - i, 0) * params[1] Math.max(params[4] - i, 0) Math.max Math params[4] - i params[4] params 4 i 0 params[1] params 1 ans = Math.min(ans, t) ans Math.min(ans, t) Math.min Math ans t System.out.println(ans) System.out.println System.out System System.out ans public class Main {

  public static void main(String[] args) {
    new Main().run();
  }

  public void run() {

    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {

      String[] lines = in.readLine().split(" ");
      int[] params = new int[lines.length];
      int k=0;
      for (String s : lines) {
        params[k++] = Integer.parseInt(s);
      }

      int ans = Integer.MAX_VALUE;
      int max = params[3] + params[4];
      for(int i=0; i<max; i++) {
        int t = 2 * params[2] * i
          + Math.max(params[3] - i, 0) * params[0]
          + Math.max(params[4] - i, 0) * params[1];
        ans = Math.min(ans, t);
      }

      System.out.println(ans);

    }
    catch(IOException e) {
      System.err.println(e);
    }
  }
} public class Main {

  public static void main(String[] args) {
    new Main().run();
  }

  public void run() {

    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {

      String[] lines = in.readLine().split(" ");
      int[] params = new int[lines.length];
      int k=0;
      for (String s : lines) {
        params[k++] = Integer.parseInt(s);
      }

      int ans = Integer.MAX_VALUE;
      int max = params[3] + params[4];
      for(int i=0; i<max; i++) {
        int t = 2 * params[2] * i
          + Math.max(params[3] - i, 0) * params[0]
          + Math.max(params[4] - i, 0) * params[1];
        ans = Math.min(ans, t);
      }

      System.out.println(ans);

    }
    catch(IOException e) {
      System.err.println(e);
    }
  }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

  public static void main(String[] args) {
    new Main().run();
  }

  public void run() {

    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {

      String[] lines = in.readLine().split(" ");
      int[] params = new int[lines.length];
      int k=0;
      for (String s : lines) {
        params[k++] = Integer.parseInt(s);
      }

      int ans = Integer.MAX_VALUE;
      int max = params[3] + params[4];
      for(int i=0; i<max; i++) {
        int t = 2 * params[2] * i
          + Math.max(params[3] - i, 0) * params[0]
          + Math.max(params[4] - i, 0) * params[1];
        ans = Math.min(ans, t);
      }

      System.out.println(ans);

    }
    catch(IOException e) {
      System.err.println(e);
    }
  }
}