#include int main() { int a, b, c, d, e; scanf("%d %d %d %d %d", &a, &b, &c, &d, &e); if (d > e) printf("%d\n", a - b + c * (d - e)); else printf("%d\n", a - b); return 0; }