a,b,c,d,e = na() print(max(a - b + c * (d - e), a - b))