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