You can use the Count tool to count objects in an image. To count objects manually, you click the image with the Count tool and Photoshop tracks the number of clicks. The count number is displayed on the item and in the Count tool options bar. Count numbers are saved when you save a file.
Photoshop can also automatically count multiple selected areas in an image, and record the results in the Measurement Log panel. See Performing a measurement.