#include <bits/stdc++.h>
struct core_string_String {
  char* p;
  int64_t len;
};
struct core_vec_Vec_core_string_String {
  struct core_string_String* data;
  bool* isinit;
  int64_t cap;
  int64_t len;
};
struct Array1024_core_prelude_Char {
  char data[1024];
};
void core_prelude_destructGG_core_prelude_Int(int64_t core_prelude_x);
void* core_pointer_nullGG_();
char* core_pointer_plusexclGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char_core_prelude_Int(
    char* core_pointer_p, int64_t core_pointer_i);
char core_string_getGG_core_prelude_CString_core_prelude_Int(
    char* core_string_cs, int64_t core_string_i);
char core_string_charGG_core_prelude_Int(int64_t core_string_c);
int64_t procon_read_intGG_();
int64_t c_minGG_core_prelude_Int_core_prelude_Int(int64_t c_x, int64_t c_y);
int64_t c_maxGG_core_prelude_Int_core_prelude_Int(int64_t c_x, int64_t c_y);
void c_mainGG_();
void core_prelude_destructGG_core_prelude_Int(int64_t core_prelude_x) {}
bool core_prelude_true;
bool core_prelude_false;
bool core_definitions_is_windows;
bool core_definitions_is_compiletime;
bool core_definitions_is_runtime;
bool core_definitions_is_jscodegen;
float core_math_M_PI;
void* core_pointer_nullGG_() {
  void* core_pointer_tmpid30 = ((void*)(0));
  return core_pointer_tmpid30;
}
void* core_pointer_null;
char* core_pointer_plusexclGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char_core_prelude_Int(
    char* core_pointer_p, int64_t core_pointer_i) {
  char* core_pointer_tmpid35 =
      ((char*)((((int64_t)(core_pointer_p)) + core_pointer_i)));
  return core_pointer_tmpid35;
}
char core_string_getGG_core_prelude_CString_core_prelude_Int(
    char* core_string_cs, int64_t core_string_i) {
  char core_string_tmpid36 = (*(
      core_pointer_plusexclGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char_core_prelude_Int(
          ((char*)(core_string_cs)), core_string_i)));
  return core_string_tmpid36;
}
char core_string_charGG_core_prelude_Int(int64_t core_string_c) {
  char core_string_tmpid39 = ((char)(core_string_c));
  return core_string_tmpid39;
}
char core_string_cr;
char core_string_lf;
int64_t procon_read_intGG_() {
  int64_t procon_ret;
  scanf("%" PRId64, &procon_ret);
  int64_t procon_tmpid63 = procon_ret;
  return procon_tmpid63;
}
bool procon_is_debug;
int64_t c_minGG_core_prelude_Int_core_prelude_Int(int64_t c_x, int64_t c_y) {
  int64_t __floritmp0;
  if ((c_x < c_y)) {
    __floritmp0 = c_x;
  } else {
    __floritmp0 = c_y;
  }
  int64_t c_tmpid65 = __floritmp0;
  return c_tmpid65;
}
int64_t c_maxGG_core_prelude_Int_core_prelude_Int(int64_t c_x, int64_t c_y) {
  int64_t __floritmp1;
  if ((c_x > c_y)) {
    __floritmp1 = c_x;
  } else {
    __floritmp1 = c_y;
  }
  int64_t c_tmpid64 = __floritmp1;
  return c_tmpid64;
}
void c_mainGG_() {
  int64_t c_a = procon_read_intGG_();
  int64_t c_b = procon_read_intGG_();
  int64_t c_c = procon_read_intGG_();
  int64_t c_x = procon_read_intGG_();
  int64_t c_y = procon_read_intGG_();
  int64_t c_m = c_maxGG_core_prelude_Int_core_prelude_Int(c_x, c_y);
  int64_t c_ans = 999999999;
  {
    int64_t c_i = 0;
    while ((c_i <= c_m)) {
      int64_t c_an = c_maxGG_core_prelude_Int_core_prelude_Int((c_x - c_i), 0);
      int64_t c_bn = c_maxGG_core_prelude_Int_core_prelude_Int((c_y - c_i), 0);
      core_prelude_destructGG_core_prelude_Int(c_ans);
      c_ans = c_minGG_core_prelude_Int_core_prelude_Int(
          c_ans, (((c_an * c_a) + (c_bn * c_b)) + ((c_i * 2) * c_c)));
      ;
      ;
      (c_i += 1);
    };
  };
  ;
  ;
  printf("%lld", c_ans);
  ;
  ;
  printf("%s", "\n");
  ;
  ;
  ;
  core_prelude_destructGG_core_prelude_Int(c_ans);
  core_prelude_destructGG_core_prelude_Int(c_m);
  core_prelude_destructGG_core_prelude_Int(c_y);
  core_prelude_destructGG_core_prelude_Int(c_x);
  core_prelude_destructGG_core_prelude_Int(c_c);
  core_prelude_destructGG_core_prelude_Int(c_b);
  core_prelude_destructGG_core_prelude_Int(c_a);
}
void flori_main() {
  core_prelude_true = 1;
  core_prelude_false = 0;
  core_definitions_is_windows = false;
  core_definitions_is_compiletime = false;
  core_definitions_is_runtime = !(core_definitions_is_compiletime);
  core_definitions_is_jscodegen = false;
  core_math_M_PI = M_PI;
  core_pointer_null = core_pointer_nullGG_();
  core_string_cr = core_string_charGG_core_prelude_Int(13);
  core_string_lf = core_string_charGG_core_prelude_Int(10);
  procon_is_debug = core_prelude_true;
  c_mainGG_();
}
int main(int argc, char** argv) { flori_main(); }
