#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int c;
  P a, b;
  cin >> a.first >> b.first >> c >> a.second >> b.second;
  if (a.first + b.first <= 2 * c) {
    cout << a.first * a.second + b.first * b.second << endl;
    return 0;
  }
  int ans = 2 * c * min(a.second, b.second);
  P l = a.second <= b.second ? b : a;
  if (l.second <= 2 * c) {
    ans += l.first * abs(a.second - b.second);
  } else {
    ans += 2 * c * abs(a.second - b.second);
  }
  cout << ans << endl;
  return 0;
}
