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