#define _DE123BUG #include using namespace std; #define endl "\n" typedef long long ll; typedef long double ld; typedef pair pii; typedef pair pll; const long double pi = acos(-1.0); const int INF = 1987654321; // const int MOD = 1e9; //// int main(){ #ifdef _DEBUG freopen ("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif ios::sync_with_stdio(false); cin.tie(NULL); ll a, b, c, d, e; cin >> a >> b >> c >> d >> e; if(d < e) cout << a - b << endl; else cout << a-b + c * (d-e) << endl; return 0; }