#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define MAX_N 10000000
#define ll longlong
using namespace std;

int main() {
    int a, b, c, x, y;
    cin>>a>>b>>c>>x>>y;
    int count=0,kazu=min(x,y);
    count+=(a*kazu+b*kazu)
    count+=(a-kazu)*a;
    count+=(b-kazu)*b;
    cout<<count<<endl;
    return 0;
}