A constant sound speed of 1540 m/s is generally used in various photoacoustic image reconstruction algorithms, based on the assumption of homogeneous sound speed in human tissue. However, the variations of sound speeds in human tissue can be as great as 10%, which can lead to distortion and blurring in the reconstruction images. To enhance the reconstructed photoacoustic image quality, an automatically selected the mean sound speed based on optimum focusing of detected photoacoustic signals is proposed. The optimum focusing is quantified by calculating the minimum average sum of the deviation of focused photoacoustic signals from the mean with various sound speeds. The method is demonstrated using homogeneous and heterogeneous sound speed numerical simulation models. The central vertical and lateral profiles of reconstructed images verify the performance of the proposed method.