def Main(): a,b,c,d,e=map(int,input().split()) print(a-b+(d-e)*c*(d>e)) Main()