#include <bits/stdc++.h>
using namespace std;
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long a, s, d, f, g;
  cin >> a >> s >> d >> f >> g;
  long long ans = 0;
  if (a + s < d * 2) {
    ans += a * f;
    ans += s * g;
  } else {
    long long mi = std::min(f, g);
    ans += d * mi;
    ans += (a - mi) * f;
    ans += (s - mi) * g;
  }
  cout << ans << endl;
  return 0;
}
