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