Recovering all color values from an image

Hy guys.
I can’t find any way to resolve this.
I am not that much aware of scripting.

My image is 40 inchs wide and 40 inches high.
its resolution is 1pxl/inche.
I turned it into indexed colors.
I then have 1600 squares (pixels) colored.

I would like to know how may square use each color.

(for exemple te background is black so there are plenty of black pixels but how much)

Any idea ?
thanks.

Sylvain