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