import java.util.Scanner;

public class Main {

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);

    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());
    int X = Integer.parseInt(sc.next());
    int Y = Integer.parseInt(sc.next());

    int cost = 0;

    if (2 * C < A && 2 * C < B) {
      cost += 2 * C * Math.max(X, Y);
    } else if (2 * C < A) {
      cost += 2 * C * X;
      if (X < Y) {
        cost += B * (Y - X);
      }
    } else if (2 * C < B) {
      cost += 2 * C * Y;
      if (Y < X) {
        cost += A * (X - Y);
      }
    } else if (2 * C < A + B) {
      if (X > Y) {
        cost += 2 * C * Y + A * (X - Y);
      } else {
        cost += 2 * C * X + B * (Y - X);
      }
    } else {
      cost += A * X + B * Y;
    }

    System.out.println(cost);
  }

} import java.util.Scanner; Scanner java.util public class Main {

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);

    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());
    int X = Integer.parseInt(sc.next());
    int Y = Integer.parseInt(sc.next());

    int cost = 0;

    if (2 * C < A && 2 * C < B) {
      cost += 2 * C * Math.max(X, Y);
    } else if (2 * C < A) {
      cost += 2 * C * X;
      if (X < Y) {
        cost += B * (Y - X);
      }
    } else if (2 * C < B) {
      cost += 2 * C * Y;
      if (Y < X) {
        cost += A * (X - Y);
      }
    } else if (2 * C < A + B) {
      if (X > Y) {
        cost += 2 * C * Y + A * (X - Y);
      } else {
        cost += 2 * C * X + B * (Y - X);
      }
    } else {
      cost += A * X + B * Y;
    }

    System.out.println(cost);
  }

} Main public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);

    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());
    int X = Integer.parseInt(sc.next());
    int Y = Integer.parseInt(sc.next());

    int cost = 0;

    if (2 * C < A && 2 * C < B) {
      cost += 2 * C * Math.max(X, Y);
    } else if (2 * C < A) {
      cost += 2 * C * X;
      if (X < Y) {
        cost += B * (Y - X);
      }
    } else if (2 * C < B) {
      cost += 2 * C * Y;
      if (Y < X) {
        cost += A * (X - Y);
      }
    } else if (2 * C < A + B) {
      if (X > Y) {
        cost += 2 * C * Y + A * (X - Y);
      } else {
        cost += 2 * C * X + B * (Y - X);
      }
    } else {
      cost += A * X + B * Y;
    }

    System.out.println(cost);
  } main {

    Scanner sc = new Scanner(System.in);

    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());
    int X = Integer.parseInt(sc.next());
    int Y = Integer.parseInt(sc.next());

    int cost = 0;

    if (2 * C < A && 2 * C < B) {
      cost += 2 * C * Math.max(X, Y);
    } else if (2 * C < A) {
      cost += 2 * C * X;
      if (X < Y) {
        cost += B * (Y - X);
      }
    } else if (2 * C < B) {
      cost += 2 * C * Y;
      if (Y < X) {
        cost += A * (X - Y);
      }
    } else if (2 * C < A + B) {
      if (X > Y) {
        cost += 2 * C * Y + A * (X - Y);
      } else {
        cost += 2 * C * X + B * (Y - X);
      }
    } else {
      cost += A * X + B * Y;
    }

    System.out.println(cost);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A = Integer.parseInt(sc.next()); A Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int B = Integer.parseInt(sc.next()); B Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int C = Integer.parseInt(sc.next()); C Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int X = Integer.parseInt(sc.next()); X Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int Y = Integer.parseInt(sc.next()); Y Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int cost = 0; cost 0 if (2 * C < A && 2 * C < B) {
      cost += 2 * C * Math.max(X, Y);
    } else if (2 * C < A) {
      cost += 2 * C * X;
      if (X < Y) {
        cost += B * (Y - X);
      }
    } else if (2 * C < B) {
      cost += 2 * C * Y;
      if (Y < X) {
        cost += A * (X - Y);
      }
    } else if (2 * C < A + B) {
      if (X > Y) {
        cost += 2 * C * Y + A * (X - Y);
      } else {
        cost += 2 * C * X + B * (Y - X);
      }
    } else {
      cost += A * X + B * Y;
    } 2 * C < A && 2 * C < B 2 * C < A 2 * C 2 C A 2 * C < B 2 * C 2 C B {
      cost += 2 * C * Math.max(X, Y);
    } cost += 2 * C * Math.max(X, Y) cost 2 * C * Math.max(X, Y) 2 * C * Math.max(X, Y) 2 C Math.max(X, Y) Math.max Math X Y if (2 * C < A) {
      cost += 2 * C * X;
      if (X < Y) {
        cost += B * (Y - X);
      }
    } else if (2 * C < B) {
      cost += 2 * C * Y;
      if (Y < X) {
        cost += A * (X - Y);
      }
    } else if (2 * C < A + B) {
      if (X > Y) {
        cost += 2 * C * Y + A * (X - Y);
      } else {
        cost += 2 * C * X + B * (Y - X);
      }
    } else {
      cost += A * X + B * Y;
    } 2 * C < A 2 * C 2 C A {
      cost += 2 * C * X;
      if (X < Y) {
        cost += B * (Y - X);
      }
    } cost += 2 * C * X cost 2 * C * X 2 * C * X 2 C X if (X < Y) {
        cost += B * (Y - X);
      } X < Y X Y {
        cost += B * (Y - X);
      } cost += B * (Y - X) cost B * (Y - X) B (Y - X) Y X if (2 * C < B) {
      cost += 2 * C * Y;
      if (Y < X) {
        cost += A * (X - Y);
      }
    } else if (2 * C < A + B) {
      if (X > Y) {
        cost += 2 * C * Y + A * (X - Y);
      } else {
        cost += 2 * C * X + B * (Y - X);
      }
    } else {
      cost += A * X + B * Y;
    } 2 * C < B 2 * C 2 C B {
      cost += 2 * C * Y;
      if (Y < X) {
        cost += A * (X - Y);
      }
    } cost += 2 * C * Y cost 2 * C * Y 2 * C * Y 2 C Y if (Y < X) {
        cost += A * (X - Y);
      } Y < X Y X {
        cost += A * (X - Y);
      } cost += A * (X - Y) cost A * (X - Y) A (X - Y) X Y if (2 * C < A + B) {
      if (X > Y) {
        cost += 2 * C * Y + A * (X - Y);
      } else {
        cost += 2 * C * X + B * (Y - X);
      }
    } else {
      cost += A * X + B * Y;
    } 2 * C < A + B 2 * C 2 C A + B A B {
      if (X > Y) {
        cost += 2 * C * Y + A * (X - Y);
      } else {
        cost += 2 * C * X + B * (Y - X);
      }
    } if (X > Y) {
        cost += 2 * C * Y + A * (X - Y);
      } else {
        cost += 2 * C * X + B * (Y - X);
      } X > Y X Y {
        cost += 2 * C * Y + A * (X - Y);
      } cost += 2 * C * Y + A * (X - Y) cost 2 * C * Y + A * (X - Y) 2 * C * Y 2 * C * Y 2 C Y A * (X - Y) A (X - Y) X Y {
        cost += 2 * C * X + B * (Y - X);
      } cost += 2 * C * X + B * (Y - X) cost 2 * C * X + B * (Y - X) 2 * C * X 2 * C * X 2 C X B * (Y - X) B (Y - X) Y X {
      cost += A * X + B * Y;
    } cost += A * X + B * Y cost A * X + B * Y A * X A X B * Y B Y System.out.println(cost) System.out.println System.out System System.out cost String[] args args public class Main {

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);

    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());
    int X = Integer.parseInt(sc.next());
    int Y = Integer.parseInt(sc.next());

    int cost = 0;

    if (2 * C < A && 2 * C < B) {
      cost += 2 * C * Math.max(X, Y);
    } else if (2 * C < A) {
      cost += 2 * C * X;
      if (X < Y) {
        cost += B * (Y - X);
      }
    } else if (2 * C < B) {
      cost += 2 * C * Y;
      if (Y < X) {
        cost += A * (X - Y);
      }
    } else if (2 * C < A + B) {
      if (X > Y) {
        cost += 2 * C * Y + A * (X - Y);
      } else {
        cost += 2 * C * X + B * (Y - X);
      }
    } else {
      cost += A * X + B * Y;
    }

    System.out.println(cost);
  }

} public class Main {

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);

    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());
    int X = Integer.parseInt(sc.next());
    int Y = Integer.parseInt(sc.next());

    int cost = 0;

    if (2 * C < A && 2 * C < B) {
      cost += 2 * C * Math.max(X, Y);
    } else if (2 * C < A) {
      cost += 2 * C * X;
      if (X < Y) {
        cost += B * (Y - X);
      }
    } else if (2 * C < B) {
      cost += 2 * C * Y;
      if (Y < X) {
        cost += A * (X - Y);
      }
    } else if (2 * C < A + B) {
      if (X > Y) {
        cost += 2 * C * Y + A * (X - Y);
      } else {
        cost += 2 * C * X + B * (Y - X);
      }
    } else {
      cost += A * X + B * Y;
    }

    System.out.println(cost);
  }

} Main
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);

    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());
    int X = Integer.parseInt(sc.next());
    int Y = Integer.parseInt(sc.next());

    int cost = 0;

    if (2 * C < A && 2 * C < B) {
      cost += 2 * C * Math.max(X, Y);
    } else if (2 * C < A) {
      cost += 2 * C * X;
      if (X < Y) {
        cost += B * (Y - X);
      }
    } else if (2 * C < B) {
      cost += 2 * C * Y;
      if (Y < X) {
        cost += A * (X - Y);
      }
    } else if (2 * C < A + B) {
      if (X > Y) {
        cost += 2 * C * Y + A * (X - Y);
      } else {
        cost += 2 * C * X + B * (Y - X);
      }
    } else {
      cost += A * X + B * Y;
    }

    System.out.println(cost);
  }

}