Electrostatic energy of a complex and infinitely extended electronic system