inputABCDE = input() ABCDE = inputABCDE.split() #print(ABCDE) A = int(ABCDE[0]) B = int(ABCDE[1]) C = int(ABCDE[2]) D = int(ABCDE[3]) E = int(ABCDE[4]) resultA = A-B#ベーコン0 resultB = A-B+C*(D-E)#ベーコンMAX if resultA > resultB: result = resultA else: result = resultB print(result)