#include #define rep(i, n) for (int i = 0; i < n; ++i) typedef long long ll; using namespace std; int main() { cin.tie(0)->sync_with_stdio(0); int A, B, C, D, E; cin >> A >> B >> C >> D >> E; int ans = max(A - B, A - B + C * (D - E)); cout << ans << "\n"; return 0; }