Charging effects on the critical temperature of the Josephson-coupled layered superconductors