### Counting how many times a certain number occurs in a cell in Libre Office Calc

I have a few cells that are filled with random numbers, eg:

cell A1: 3937376385699290

cell B1: 6568408355712890000

and I want Libre Office Calc to tell me how many 1's, 2's, 3's, 4's, etc are all together in those 10 or so cells.
So in the case of the above two cells, there are 1 1's, 2 2's, 5 3's, and so on

I tried COUNT and FIND but they didn't work

All help appreciated :)