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