#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, k, num, num1;
  cin >> n >> m >> k >> num >> num1;
  if (2 * k <= n + m)
    cout << (2 * k * min(num, num1)) + (m * max(num1 - num, (long long int)0)) +
                (n * max(num - num1, (long long int)0))
         << '\n';
  else
    cout << (n * num) + (m * num1) << '\n';
}
