#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  int res;
  int big = x >= y ? x : y;
  int small = x < y ? x : y;
  if (a >= 2 * c && b >= 2 * c) {
    res = 2 * c * big;
  } else if (a < c / 2 && b < c / 2) {
    res = a * x + b * y;
  } else {
    if (a + b <= 2 * c) {
      if (x > y) {
        if (x > 2 * c) {
          res = (a + b) * small + 2 * c * (big - small);
        } else {
          res = (a + b) * small + a * (big - small);
        }
      } else {
        if (y > 2 * c) {
          res = (a + b) * small + 2 * c * (big - small);
        } else {
          res = (a + b) * small + b * (big - small);
        }
      }
    } else {
      if (x > y) {
        if (x > 2 * c) {
          res = 2 * c * small + 2 * c * (big - small);
        } else {
          res = 2 * c * small + a * (big - small);
        }
      } else {
        if (y > 2 * c) {
          res = 2 * c * small + 2 * c * (big - small);
        } else {
          res = 2 * c * small + b * (big - small);
        }
      }
    }
  }
  cout << res << endl;
  return 0;
}
