A, B, C, D, E = map(int, input().split()) ans = A - B if D > E: ans += (D - E) * C print(ans)