a,b,c,d,e=map(int,input().split()) print(a-b+max(0,c*(d-e)))