In the circuit shown in the figure, the capacitor C is charged to a potential V0. The heat generated in the circuit when the switch S is closed, is :