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