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