def solve(a, b, c, d, e): if d <= e: return a - b return (a - b) + (d - e) * c print(solve(*list(map(int, input().split()))))