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