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