A bar magnet with magnetic moment of 5 Am2 is lying at stable equilibrium in external uniform magnetic field of strength 0.4T. Work done in slowly rotating the bar magnet to the position of unstable equilibrium is equal to
(1) 1 J
(3) 3 J
(2) 2 J
(4) 4 J