#include <bits/stdc++.h>
using namespace std;
int main() {
  int64_t a, b, c, d, e;
  cin >> a >> b >> c >> d >> e;
  int r = min(d, e);
  int t = 0;
  for (int i = 0; i < r + 1; i++) {
    int g = c * i + (d - i) * a + (e - i) * b;
    t = max(t, g);
  }
  cout << t;
}
