calculate item discount considering item count