def Main(): a,b,c,d,e=map(int,input().split()) if e>d: print(a-b) else: print(a-b+(d-e)*c) Main()