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