How do I get the unique count of values in a cell separated by comma in excel?

For example: cell B13 has the value

`1,1,2,3,7,1`

Using the below formula we get the count of values separated by `,`

as 6.

`=1+LEN(B13)-LEN(SUBSTITUTE(B13,";",""))`

But I want to count the unique values in the cell B13, which is 4. Can someone help me achieve this?

Note: This question is similar to How can I count unique comma-separated values in Excel 2010. However, this is a special, restrictive case (the values are only single digits), which allows solutions that would not apply to the other question.