#include using namespace std; using ll = long long; #define fi first #define se second #define all(a) a.begin(),a.end() int main(){ int a,b,c,d,e; cin >> a >> b >> c >> d >> e; int happy=a-b; if(d>e) happy+=c*(d-e); cout << happy << endl; return 0; }