Counting the value of a digit up to 99