#include #include using namespace std; int main() { int a, b, c, d, e; cin >> a >> b >> c >> d >> e; int ans = a - b; if (d - e >= 0) { ans += (d - e) * c; } cout << ans << endl; }