#include <bits/stdc++.h>
using namespace std;
const int inf = 1000000007;
const int mod = 1000000007;
const double PI = 3.14159265358979323846;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
int gcd(int a, int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int main() {
  int A, B, C, X, Y;
  cin >> A >> B >> C >> X >> Y;
  int ans = inf;
  for (int i = max(A, B); i >= 0; i--) {
    ans = min(ans, 2 * i * C + A * max(0, X - i) + B * max(0, Y - i));
  }
  cout << ans << endl;
  return 0;
}
