#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  long long A = 0, B = 0, C, X, Y;
  cin >> A >> B >> C >> X >> Y;
  if (A + B < C * 2) {
    cout << A * X + B * Y;
    return 0;
  } else {
    long long count = min(X, Y);
    cout << count * 2 * C + A * (X - count) + B * (Y - count);
    return 0;
  }
  return 0;
}
