def main(): a, b, c, d, e = map(int, input().split()) ans = max(a - b, a - b + (d - e) * c) print(ans) if __name__ == "__main__": main()