#include <bits/stdc++.h>
using namespace std;
const int INF = 9999999;
const int MOD = 1e9 + 7;
int main() {
  int a, b, c, d, e;
  cin >> a >> b >> c >> d >> e;
  cout << min({min(d, e) * c + c * abs(d - e), a * d + b * e}) << endl;
}
