a, b, c, d, e = map(int, input().split()) n = a * (b - c) x = d ans = 0 for i in range(1, n + 1): if i % 1 != 0: ans += x elif e <= x: ans += x - e bef = x - e else: ans += x print(ans)