a, b, c, d, e = map(int, input().split()) deli = a cal = b ans = deli - cal for x in range(c): deli += d cal += e ans = max(ans, deli - cal) print(ans)