Entropy change at magnetic phase transitions of the first order and second order