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