#include #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") int main(void) { int a, b, c, d, e; scanf("%d %d %d %d %d", &a, &b, &c, &d, &e); printf("%d\n", (d < e) ? a - b : a - b + (d - e) * c); return 0; }