a,b,c,d,e = map(int, input().split()) print(max(a - b + c * (d - e), a - b))