A, B, C, D, E = map(int, input().split(' ')) if D - E < 0: print(A - B) else: print(A - B + C * (E + D))