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