A, B, C, D, E = map(int, input().split()) A -= B D -= E print(max(A, A + C * D))