Self energy of each shell is given by qφ/2 where φ is the potential of the shell, created only by the charge q, on it.
Hence, self energy of the shells 1 and 2 are :

The interaction energy between the charged shells equals charge q of one shell, multiplied by the potential φ, created by other shell, at the point of location of charge q.
