Photoacoustic imaging techniques requires the knowledge of the speed of sound distribution of background which is not available prior to imaging process. The estimation of SoS in a layered media is a difficult task due to the nonlinearity of the wave propagation. In this work, we proposed a novel Hybrid Focusing Metric (HFM) for accurate image quality assessment in an autofocusing approach to estimate the speed of sound distribution of layered media. In the proposed metric, contrast resolution and spatial resolution information were combined into a novel hybrid focusing metric to enhance the image quality assessment by exploiting intensity-based focusing metrics and pixel count metrics. We have demonstrated that with HFM, the estimation accuracy is increased compared to the state-of-the-art metrics through numerical simulations using k-Wave toolbox.