#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long powmod(long long a, long long b, long long MOD) {
  long long ans = 1;
  while (b) {
    if (b % 2) ans = ans * a % MOD;
    a = a * a % MOD;
    b /= 2;
  }
  return ans;
}
inline void getInt(int* p);
const int maxn = 1000010;
const int inf = 0x3f3f3f3f;
int main() {
  long long a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  c *= 2;
  long long fans = min(a * x + b * y, c * max(a, b));
  long long ans = 0ll;
  long long num = min(x / 2, y / 2);
  ans += 2ll * num * (min(c, a + b));
  x -= 2 * num;
  y -= 2 * num;
  ans += (min(max(x, y) * c, x * a + y * b));
  ans = min(ans, fans);
  cout << ans << endl;
  return 0;
}
inline void getInt(int* p) {
  char ch;
  do {
    ch = getchar();
  } while (ch == ' ' || ch == '\n');
  if (ch == '-') {
    *p = -(getchar() - '0');
    while ((ch = getchar()) >= '0' && ch <= '9') {
      *p = *p * 10 - ch + '0';
    }
  } else {
    *p = ch - '0';
    while ((ch = getchar()) >= '0' && ch <= '9') {
      *p = *p * 10 + ch - '0';
    }
  }
}
