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