a, b, c, d, e = map(int, input().split()) ans = a - b ans += max(0, c * (d - e)) print(ans)