calculate the amount of damage