A, B, C, D, E = [int(x) for x in input().split()] print((A - B) + C * max(D - E, 0))