A magnetic dipole with magnetic moment M is placed at right angles to a magnetic field B. If it is rotated by an angle of 1800, the total work done is