int A, B, C, X, Y;

int main(){
    cin >> A >> B >> C >> X >> Y;
    int AB = 2 * C;
    int ans = 1000000;
    for (int i = 0; i < 5; i++){
        int price = A * max(X - i, 0) + B * max(Y - i, 0) + AB * i;
        ans = min(price, ans);
    }
    cout << ans << endl;
}